说明: 执行当前 Web 请求期间,出现未处理的异常
SqlConnectioncon=newSqlConnection(ConfigurationManager.ConnectionStrings["ConnectionS...
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
con.Open();
string getId = "select max(ID) from xwsj";
SqlCommand getI = con.CreateCommand();
getI.CommandText = getId;
SqlDataReader readI = getI.ExecuteReader();
readI.Read();
int varId;
if (readI["ID"].ToString() == "")
{
varId = 1;
}
else
{
varId = Convert.ToInt32(readI["ID"].ToString()) + 1;
}
readI.Close(); 展开
con.Open();
string getId = "select max(ID) from xwsj";
SqlCommand getI = con.CreateCommand();
getI.CommandText = getId;
SqlDataReader readI = getI.ExecuteReader();
readI.Read();
int varId;
if (readI["ID"].ToString() == "")
{
varId = 1;
}
else
{
varId = Convert.ToInt32(readI["ID"].ToString()) + 1;
}
readI.Close(); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询