I am getting a Nullpointer on this code:
public void InsertImportantMsg (string msg, DateTime toDay, int visible)
{
connection.Open ();
string query = "UPDATE IMPORTANTMESSAGE SET MESSAGES=':msg', DATETIME=':toDay', " +
"LABELVISIBILITY=':visible'";
connection.CreateCommand ();
cmd.CommandText = query;
cmd.Parameters.Add (":msg", msg);
cmd.Parameters.Add (":toDay", toDay);
cmd.Parameters.Add(":visible", visible);
cmd.ExecuteNonQuery ();
}
Specifically at this line:
cmd.CommandText = query;
I am passing the parameters right. Is there something wrong with my update statement, that I don't realize?
(I know the code should be in try catch, but it's on purpose for now, so don't look at that)
Thanks