Hi All,
I'm trying to insert a new record into my SQL Server dataabse. The first column is an automatically-generated identity field. I want to retrieve the ID number of the new row when I add the record using,
string NewID = command.ExecuteScalar().ToString();
For some reason, the ExecuteScalar() method throws a NullReferenceException, so I'm guessing it's not returning everything, and I'm not sure why. Can anyone help?
Cheers,
Mat