D
David W
I am trying to get the unique id that is created when an insert is done, so
I thought I would use Execute reader public SqlCeDataReader
ExecuteReader(); instead of ExecuteNonQuery, so that I get returned back to
me the row that was just inserted. Both commands insert the record ok, but
the SqlCeDataReader returned is invalid when i try:
SqlCeDataReader dataReader = cmdDML.ExecuteReader(CommandBehavior.Default);
dataReader.Read();
dataReader.GetInt32(0);//Throws Exception
Can I use ExecuteReader like this or is there an easier way to get the
unique id?
Thanks
I thought I would use Execute reader public SqlCeDataReader
ExecuteReader(); instead of ExecuteNonQuery, so that I get returned back to
me the row that was just inserted. Both commands insert the record ok, but
the SqlCeDataReader returned is invalid when i try:
SqlCeDataReader dataReader = cmdDML.ExecuteReader(CommandBehavior.Default);
dataReader.Read();
dataReader.GetInt32(0);//Throws Exception
Can I use ExecuteReader like this or is there an easier way to get the
unique id?
Thanks