Hi I am submitting a form to access but want to get the access assigned auto number to display in a textbox after I submit. Below it was i have, any suggestions would be great!
string cmdstr = "Insert into TaskPerformed(TaskType,OtherType,Analyst,DateCompleted)Values(@b,@c,@d,@e)";
string query2 = "Select @@IDENTITY";
OleDbConnection con1 = new OleDbConnection(constr);
OleDbCommand com = new OleDbCommand(cmdstr, con1);
OleDbCommand cmdNewID = new OleDbCommand("SELECT @@IDENTITY", con1);//
con1.Open();
cmd.CommandText = query2;
com.ExecuteNonQuery();
con1.Close();
label16.Text = cmdNewID.ToString();