4
Reply

Why do I get a 0 value for my @@identity field?

hey_mr_art

hey_mr_art

Jun 5 2004 1:54 AM
2.6k
Good Day, I have a form that retrieves the next available auto-number value of a field in MSACCESS 2000 every time it loads, unfortunately it returns a 0 value. Here is my code: connection.Open(); int newid; OleDbCommand command = new OleDbCommand("Select @@identity From IssuanceHeader", connection); newid = (int) command.ExecuteScalar(); txtIssuanceNo.Text = newid.ToString(); connection.Close(); Is there something wrong?

Answers (4)