I'm working on a bot for something and I keep hitting blanks and getting an error. I asked a friend of mine for help but he couldn't find the issue.
The code is:
sqlConn and sqlComm are defined at the top of the file. They are assigned in this function.
The problem:
Any insight or help would be appreciated.
The code is:
Code:
sqlConn = new SQLiteConnection("Data Source=botinfo.db;Version=3;New=False;Compress=True;Journal Mode=Off;");
sqlConn.Open();
sqlComm = new SQLiteCommand();
sqlComm.Connection = sqlConn;
sqlComm.CommandText = "DELETE FROM bot_controllers WHERE controller_name = '" + controllerName + "';";
sqlComm.ExecuteNonQuery();
sqlConn.Close();
sqlConn and sqlComm are defined at the top of the file. They are assigned in this function.
The problem:
Code:
System.NullReferenceException: Object reference not set to an instance of an obj
ect.
at System.Data.SQLite.SQLite3.Prepare(SQLiteConnection cnn, String strSql, SQ
LiteStatement previous, UInt32 timeoutMS, String& strRemain)
at System.Data.SQLite.SQLite3.Reset(SQLiteStatement stmt)
at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt)
at System.Data.SQLite.SQLiteDataReader.NextResult()
at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavi
or behave)
at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery()
at FurcBot.Classes.botSockets.removeController(String controllerName) in C:\U
sers\Joseph\documents\visual studio 2010\Projects\ConsoleApplication1\ConsoleApp
lication1\Classes\botSockets.cs:line 435
Any insight or help would be appreciated.