private int GetNextStudentID()
{
command.CommandText = "SELECT IDENT_CURRENT ('admn') + IDENT_INCR ('admn')";
try
{
connection.Open();
int nextID = Convert.ToInt32(command.ExecuteScalar());// here i am getting error
return nextID;
}
catch (SqlException ex)
{
MessageBox.Show(ex.Message);
}
finally
{
connection.Close();
}
return 0;
}