INSERT INTO with sqlCommand object not working
Posted on 2004-09-13
When I use the following code:
strSQL = "INSERT INTO tblCookTimes(ItemNum, KettleSize, Cooktime) VALUES ('8085001013', '650', '60' )"
cmdUpdateTime.CommandText = strSQL
I get an error saying that the field "RecID" in the table "tblCookTimes" cannot be null.
I know that I set RecID as an Identity set to increment by 1 and that if I use a straight SQL statement in SQL Query Analyzer it will work and just insert the record and increment the RecID. But in code it fails.
How do I get around this? Thanks in advance.