Q
Quentin Huo
Hi:
I have a table which key is an identity integer ID named "readerID", so the
readerID is created by system after I insert the new record. I use the
following code to insert a new record:
strng sql = "INSERT ......";
OleDbConnection conn = new OleDbConnection();
conn.ConnectionString = Session["oleconn"].ToString();
conn.Open();
OleDbCommand cmd = new OleDbCommand(sql,conn);
int nNoAdded = cmd.ExecuteNonQuery();
I need to retrive the ID just after insert a new record, how can I do this?
In ASP, I don't need to use the query again. But I don't know how to do this
in ASP.NET.
Thanks
Q.
I have a table which key is an identity integer ID named "readerID", so the
readerID is created by system after I insert the new record. I use the
following code to insert a new record:
strng sql = "INSERT ......";
OleDbConnection conn = new OleDbConnection();
conn.ConnectionString = Session["oleconn"].ToString();
conn.Open();
OleDbCommand cmd = new OleDbCommand(sql,conn);
int nNoAdded = cmd.ExecuteNonQuery();
I need to retrive the ID just after insert a new record, how can I do this?
In ASP, I don't need to use the query again. But I don't know how to do this
in ASP.NET.
Thanks
Q.