关于BindingSource的问题~~~
为什么上面的能正常过滤,而下面的不行int id = int.Parse(this.textBox2.Text);
bs.Filter = "StudentId =" + id;
string name1 = this.textBox2.Text;
bs.Filter = "Name =" + name1;
如果改为
bs.Filter = "Name ='张三'"; 就能正常过滤
请问怎样能把'张三'变成变量? --------------------编程问答-------------------- "Name="+"张山"等于"Name=张山"不等于"Name='张山'" --------------------编程问答-------------------- Name 是字符型要加单引号 --------------------编程问答-------------------- 问题解决
只要所语句改下面那样就行了
name1 = this.textBox2.Text;
bs.Filter = "Name ='" + name1 + "'";
补充:.NET技术 , C#