I try
CODE:::::::
private int GetNewId()
{
int newID = 0;
str = "SELECT MAX(Usedphone_Id) FROM usedphonedtls";
//create connection,
//create command
//use sqlDataReader to read the last inserted id
newID = (int)reader[0];
//increase it by 1 to get the new number (id):
return newID++;
}
I cant understand
newID = (int)reader[0];
Edited by Roger, 25 February 2011 - 03:51 AM.
added code block


Sign In
Create Account


Back to top









