关于sql语句max值的问题,知道的帮忙看一下
string strSql,strConn,num;
int maxvalue ;
maxvalue = 0;
strConn = WebConfigurationManager.ConnectionStrings[1].ConnectionString;
strSql = "select max(substring(gcbm,16,2)) as maxvalue from sggcjbqkb where substring(gcbm,7,8)='"+dd +"'";
SqlConnection sc = new SqlConnection();
sc.ConnectionString = strConn;
sc.Open();
Response.Write(maxvalue);
num = Convert.ToString(maxvalue + 1);
-----------
sql语句
strSql = "select max(substring(gcbm,16,2)) as maxvalue from sggcjbqkb where substring(gcbm,7,8)='"+dd +"'";
中的maxvalue的值在程序运运