jackow98 / F20SC---CW1

1 stars 0 forks source link

Adding Tab to SQLite #1

Open jackow98 opened 5 years ago

jackow98 commented 5 years ago
System.Data.SQLite.SQLiteException: SQL logic error
near "SELECT": syntax error
  at at System.Data.SQLite.SQLite3.Prepare(SQLiteConnection cnn, String strSql, SQLiteStatement previous, UInt32 timeoutMS, String& strRemain)
  at at System.Data.SQLite.SQLiteCommand.BuildNextCommand()
  at at System.Data.SQLite.SQLiteCommand.GetStatement(Int32 index)
  at at System.Data.SQLite.SQLiteDataReader.NextResult()
  at at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
  at at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
  at at System.Data.SQLite.SQLiteCommand.ExecuteDbDataReader(CommandBehavior behavior)
  at at System.Data.Common.DbCommand.ExecuteReader()
  at at System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult)
  at at System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries)
  at at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
  at at System.Data.Linq.ChangeDirector.StandardChangeDirector.DynamicInsert(TrackedObject item)
  at at System.Data.Linq.ChangeDirector.StandardChangeDirector.Insert(TrackedObject item)
  at at System.Data.Linq.ChangeProcessor.SubmitChanges(ConflictMode failureMode)
  at at System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode)
  at at System.Data.Linq.DataContext.SubmitChanges()
  at Browser.DatabaseFunctionality.WriteToDatabase() in C:\Users\Owner\.ssh\F20SC---CW1\Coursework\WindowsFormsApplication2\DatabaseFunctionality.cs:125
  at Browser.DatabaseFunctionality.AddTab() in C:\Users\Owner\.ssh\F20SC---CW1\Coursework\WindowsFormsApplication2\DatabaseFunctionality.cs:101
  at Browser.BrowserWindow`1.loadTabsToGui() in C:\Users\Owner\.ssh\F20SC---CW1\Coursework\WindowsFormsApplication2\BrowserWindow.cs:57
  at Browser.BrowserWindow`1..ctor() in C:\Users\Owner\.ssh\F20SC---CW1\Coursework\WindowsFormsApplication2\BrowserWindow.cs:21
  at Browser.Program.Main() in C:\Users\Owner\.ssh\F20SC---CW1\Coursework\WindowsFormsApplication2\Program.cs:22
jackow98 commented 5 years ago

Removing IsDbGenerated = true from Tabs declaration in Tables.cs stopped error, unsure why. See commit https://github.com/jackow98/F20SC---CW1/commit/66912917e5e339672f146ca5eb2ab68dd8f697f1