Hey guys, I'm finishing up a class project and I'm having trouble with automatically creating primary keys for various tables. I'm wanting the C# code behind the Aspx to look into my 'Events' table and find the last occurring entry then take that Primary Key and add 1 to it, then display that new number in a greyed out textbox, and eventually save it to the db with InsertParameters if the entry is submitted. I'm pretty new to both C# and ASP.net and didn't know if you all could help me figure this out! Also how would I scan through the DB with a loop to see if the new number already exists? Thanks Everyone!
Hi there, You can scan each row using ADO.NET Dataset, loop through dataset using eg foreach( ds.rows.count>0) Regards, WS