String strSQLcheck="select 模块名称 from 产品模块 where 产品ID="+i;
String strSQLcheck="select 模块名称 from 产品模块 where 产品ID=i"这句话错了吧?应该这么写吧? String strSQLcheck="select 模块名称 from 产品模块 where 产品ID= '"+i+"'";你要把他分开写才能认得出 int i.
string strSQLcheck="select 模块名称 from 产品模块 where 产品ID="+i.ToString();
查询条件值是string必须加那两个单引号
String strSQLcheck="select 模块名称 from 产品模块 where 产品ID={0}"; string temp=string.format(strSqlcheck,i); SqlCommand cb2 = new SqlCommand(temp,objConnection2);
string d = ddlProductFilter.SelectedValue; int i=(int)Convert.ChangeType(d,typeof(int));String strSQLcheck="select 模块名称 from 产品模块 where 产品ID={0}"; string temp=string.format(strSqlcheck,i); SqlCommand cb2 = new SqlCommand(temp,objConnection2);
String strSQLcheck="select 模块名称 from 产品模块 where 产品ID= '"+i+"'";你要把他分开写才能认得出 int i.
string temp=string.format(strSqlcheck,i);
SqlCommand cb2 = new SqlCommand(temp,objConnection2);
int i=(int)Convert.ChangeType(d,typeof(int));String strSQLcheck="select 模块名称 from 产品模块 where 产品ID={0}";
string temp=string.format(strSqlcheck,i);
SqlCommand cb2 = new SqlCommand(temp,objConnection2);