Have you tried @@IDENTITY?
LizR
Posting Virtuoso
1,791 posts since Aug 2008
Reputation Points: 196
Solved Threads: 190
You need to provide some of the errors, and the code you used as we cannot see through our monitors to yours to see whats going on.
LizR
Posting Virtuoso
1,791 posts since Aug 2008
Reputation Points: 196
Solved Threads: 190
Kinda hard but, where?
other than not obviously reusing the connection you make to the db only thing I can see would be
MessageBox.Show(exc.ToString());
So, where is the error generated, which line?
only other stab is that it errors on the @@IDENTITY part because you havent added any records to retrieve the @@IDENTITY of the last record added.
LizR
Posting Virtuoso
1,791 posts since Aug 2008
Reputation Points: 196
Solved Threads: 190
OK, no point getting ranty, firstly you have google, just like the rest of us do when we want to look something up, given you know the name of it, reading more about it should be possible and a lot of the reading will have examples.
OK, you dont say why you cant get stdid from the database, why not? what happens? debugging more often than not will show you why something doesnt work.
Once you have stdid, Im guessing the second part will be part resolved too
LizR
Posting Virtuoso
1,791 posts since Aug 2008
Reputation Points: 196
Solved Threads: 190
Autonumber field must have value.
look at your table
Thank you for your input. However, this thread is more than two years old.
I am sure that by now the original problem has been solved.
Please pay attention to the big message above the post window that statesThis thread is more than three months old
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
nick.crane
Nearly a Posting Virtuoso
1,230 posts since Feb 2010
Reputation Points: 375
Solved Threads: 187
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847