Vb.net 2010,如何同时使用两个滤镜
Vb.net 2010, how to use two filters at the same time
我想在 Visual Basic 中同时使用两列来过滤数据网格视图。例如:我想过滤主题列和姓氏列,
我目前正在使用此代码:
me.studentbindingsource.filter = "Subject_code like '%" & ComboBox1.Text & "%'"
但它一次只能过滤一个。
使用String.Format,
me.studentbindingsource.filter = String.Format("Subject_code like '{0}**' and Last_name like '{1}*'",Combobox1.text,strLastname)
我想在 Visual Basic 中同时使用两列来过滤数据网格视图。例如:我想过滤主题列和姓氏列,
我目前正在使用此代码: me.studentbindingsource.filter = "Subject_code like '%" & ComboBox1.Text & "%'"
但它一次只能过滤一个。
使用String.Format,
me.studentbindingsource.filter = String.Format("Subject_code like '{0}**' and Last_name like '{1}*'",Combobox1.text,strLastname)