Anyone knows why tihs code doesn't work?
Program says "Invalid use of null".
In access thise code is working, but not hire. UPDATE cas SET cas.skupaj = CDbl([Odhod]-[Prihod])*24;
try
{
OleDbConnection conn = GetConnection();
conn.Open();
String MyString = @"UPDATE cas SET skupaj = CDbl(Odhod-Prihod)*24 " ;
OleDbCommand command = new OleDbCommand(MyString, conn);
command.ExecuteNonQuery();
conn.Close();
MessageBox.Show("Uspešno dodano v PB!");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
Invalid use of nullis an Access error message. How are you getting that in C# code? When you say this works in access, that means you can run that exact SQL statement above in Access without any errors?Odhod Not Null and Prihod Not Null.