How do I change this:
using (SqlCommand myCommand = myConnection.CreateCommand())
{
myConnection.Open();
myCommand.CommandText = "SELECT FormID FROM tbl_Form";
using (SqlDataReader reader = myCommand.ExecuteReader())
{
while (reader.Read())
{
int FormID = reader.GetInt32(reader.GetOrdinal("FormID"));
MessageBox.Show(FormID.ToString());
}
}
}
to get MAX(FormID) ?
My natural tendency is to throw a MAX around FormID but I'm getting an IndexOutOfRange exception.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…