string db = "abc.mdb";
string s = "Provider=Microsoft.Jet.OLEDB.4.0 ; Data Source="+db;
是不是这个意思?
或:
string sql = "select * from table where 字段1=" + db ;

解决方案 »

  1.   

    不是,使我的一个变量,要被用到SQL语句中,举个例子:SELECT * FROM TABLE1 WHERE SS=STRING; 其中STRING是C#中的字符变量!
      

  2.   

    String command = "Select * from table1 where ss =" + STRING;
    OracleDataAdaper dsCommand = new OracleDataAdapter();
    DataSet dataSet = new DataSet();
    dsCommand.SelectCommand = new OracleCommand( command, connectionString//联接字符串
    );
    dsCommand.Fill( dataSet );
      

  3.   

    String command = "Select * from table1 where ss ='" + STRING +"'";
      

  4.   

    SQL="Select distinct new_sensor_code from cell_sensor_list where cell_code in ('" + tmpCellCode + "')";
      

  5.   

    "+ your_vars +"这个没有问题,注意空格什么的