August 13, 2012

Unabled to view newly inserted row in table

Add new item in my ventory and also create a log file in which each transaction will be recorded. After adding record via store procedure it show me none of row in SQL server database as i also save their newly inserted id into log file and when i select rows according to that id it showed nothing. Let me clearify you that ID is auto generated in database.

If you are sure that your record is well inserted into the db, you can try to do this:

var result = (from e in XXXX
order e by e.Id desc
select e).First();

to see the result.