SqlDataReader myReader = mysqlCommand.ExecuteReader(CommandBehavior.CloseConnection);
decimal MaxId = 0;//设有断点 if (myReader.Read())
{
MaxId = myReader.GetDecimal(0) + 1;
}
myReader.Close();
decimal MaxId = 0;//设有断点 if (myReader.Read())
{
MaxId = myReader.GetDecimal(0) + 1;
}
myReader.Close();
if(myReader.Read())
{ //有记录
MaxId = myReader.GetDecimal(0) + 1;
}
else
{MaxId = 1;}
错误同上