C# 指定了非布尔类型的表达式~新手,望大师帮帮忙
我说下我想实现的程序,我想通过填写textBox1中得数据,转换到数据库中调出相应表的相应字段,然后再将界面中其他textBox13,textBox14,textBox15中得数据一起,转入数据库的另一张表里,我想的方法是下面的程序,但不行,出现了一句什么什么地方(应该是textBox1附近)指定了非布尔类型的表达式,晕,研究半天未果,来这找找大神,看看
SqlConnection sc = new SqlConnection("server=localhost;database=guestbook;uid=gx;pwd=123");
sc.Open();
SqlDataAdapter sda = new SqlDataAdapter("select * from 货物信息 where '" + textBox1.Text
+ "'", sc);
DataSet ds = new DataSet();
sda.Fill(ds);
string a = ds.Tables[0].Rows[1]["货物编号"].ToString();
string b = ds.Tables[0].Rows[1]["发货人"].ToString();
string c = ds.Tables[0].Rows[1]["发货人电话"].ToString();
string d = ds.Tables[0].Rows[1]["发货地址"].ToString();
string f = ds.Tables[0].Rows[1]["收货人"].ToString();
string g = ds.Tables[0].Rows[1]["收货人电话"].ToString();
string h = ds.Tables[0].Rows[1]["收货地址"].ToString();
string i = ds.Tables[0].Rows[1]["货物名称"].ToString();
string j = ds.Tables[0].Rows[1]["货物数量"].ToString();
string k = ds.Tables[0].Rows[1]["货物重量"].ToString();
string l = ds.Tables[0].Rows[1]["货物体积"].ToString();
string m = ds.Tables[0].Rows[1]["货物描述"].ToString();
string n = ds.Tables[0].Rows[1]["运输要求"].ToString();
string sql = "update 集装箱信息 set 集装箱状态 = '使用中' where 集装箱箱号 = '" + textBox13.Text
+ "';insert into 装箱单 values('" + a + "','" + b + "','" + c +"','" + d +"','" + f +"','" + g
+ "','" + h + "','" + i + "','" + j + "','" + k + "','" + l + "','" + m + "','" + n +"','"
+ textBox13.Text + "','" + textBox14.Text + "','" + textBox15.Text + "' ) ";
//MessageBox.Show(sql);
SqlCommand scom = new SqlCommand(sql, sc);
scom.ExecuteNonQuery();
sc.Close();
望大师指点