String strSQLcheck="select 模块名称 from 产品模块 where 产品ID="+i.ToString();

解决方案 »

  1.   

    String strSQLcheck="select 模块名称 from 产品模块 where 产品ID="+i;
      

  2.   

    String strSQLcheck="select 模块名称 from 产品模块 where 产品ID=i"这句话错了吧?应该这么写吧?
    String strSQLcheck="select 模块名称 from 产品模块 where 产品ID= '"+i+"'";你要把他分开写才能认得出 int i.
      

  3.   

    string strSQLcheck="select 模块名称 from 产品模块 where 产品ID="+i.ToString();
      

  4.   

    查询条件值是string必须加那两个单引号
      

  5.   

    String strSQLcheck="select 模块名称 from 产品模块 where 产品ID={0}";
    string temp=string.format(strSqlcheck,i);
    SqlCommand cb2 = new SqlCommand(temp,objConnection2);
      

  6.   

    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);