sCnd = "INSERT INTO .dbo.Table(Col1, Col2, Col3) Values (1,2,3);
using (DbCommand tempCommand2 = CommandFactory.CreateCommand(db))
{
tempCommand2.CommandText = sCmd;
tempCommand2.ExecuteNonQuery();
}
Table has also a Col4 that does not allow null.
Error: Cannot insert the value NULL into column Col4
When I execute the sCmd in the Management Studio everything works fine.
Why do I get the exception?