VB.NET RowFilter in DataGridView
Hi
I am tray to use RowFilter in DataGridView I have Address and Postal code try to search need little help with this Please
need to search Address but sometime I seed Postal code if the list is to big
Code:
dt.DefaultView.RowFilter = Cbo_Address_filter.Text + " " + "LIKE '%" + Txt_Address_string.Text + "%'" And Cbo_Postal_code_filter.Text + " " + "LIKE '%" + Txt_Postal_code_string.Text + "%' "
Regards
ssalomon
Re: VB.NET RowFilter in DataGridView
That is terrible code I'm afraid. It's hard to read and that is exactly why you have botched it and can't see it. Learn to use String.Format:
vb.net Code:
String.Format("{0} LIKE '%{1}%' AND {2} LIKE '%{3}%'",
Cbo_Address_filter.Text,
Txt_Address_string.Text,
Cbo_Postal_code_filter.Text,
Txt_Postal_code_string.Text)
Re: VB.NET RowFilter in DataGridView
Thanks jmcilhinney will check this out with String.Format
ssalomon