利用toolStripTextBox查找数据在datagridview中显示

private void toolStripTextBox2_TextChanged(object sender, EventArgs e)
  {
 string str = "SELECT Record_no,OutBound_no,Spareparts_no,Spareparts_name,Suppliername,Category,TotalNumber,TotalWeight,CK_no,Shelve_no,"
 + "OutputTime,Class,Sequence,OutBounder_no,DeliveryMan_no,OutputMode,Inventory_No,Insert_Time,Other From T_BJ_OutBound where OutBound_no like '%" + toolStripTextBox2.Text.Trim() + "%' order by Record_no";
            conn = new OracleConnection(ConnectionString);
            da = new OracleDataAdapter(str, conn);  //创建数据适配器对象
            DataSet ds = new DataSet();  //创建数据集对象
            da.Fill(ds);     //填充数据集
            dataGridView2.DataSource = ds.Tables[0];  //绑定到数据表
            ds.Dispose();  //释放资源
            bindingSource1.DataSource = ds.Tables[0];
            this.bindingNavigator1.BindingSource = bindingSource1;
            this.dataGridView2.DataSource = bindingSource1;
  }

你可能感兴趣的:(String,object,Class,insert,dataset)