问题描述
我希望我的searchbox.text不仅显示LastName,而且还显示FirstName ...通过使用空格或逗号,这两个中的任何一个。
这是我的代码
Dim dv As New DataView(dbdataset)
dv.RowFilter = String.Format(LastName Like'%{0}%',TextBox6.Text)
DataGridView1.DataSource = dv
提前感谢...
Hi,
I'd like my searchbox.text to display not only the LastName but corresponded by FirstName... by using a space or a comma, any of those two.
this is my code
Dim dv As New DataView(dbdataset)
dv.RowFilter = String.Format("LastName Like '%{0}%'", TextBox6.Text)
DataGridView1.DataSource = dv
thanks in advance...
推荐答案
"LastName Like '%{0}%' Or FirstName Like '%{1}%'"
如果你想在第一个和最后一个名字的条件中嵌入空格,请考虑类似
If you want to embed space to the condition for first and last name consider something like
"LastName Like '% {0}%' Or FirstName Like '%{1} %'"
有关可能表达式的信息,请参阅 []
这篇关于如何使用rowfilter在一个文本框中获取2个字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!