filter datagridview with textbox for numeric fields?

Pure Heart

New member
Joined
Nov 18, 2013
Messages
1
Programming Experience
Beginner
I'm trying to do search in my access database using VB.net form
my code is working correctly
but I don't know how to do this with numeric fields

I have form with datagridview , textbox and button

my code :
MyDBBindingSource.Filter = String.Format("job LIKE '{0}%' Or address LIKE '{0}%' Or Fname LIKE '{0}%'", TextBox1.Text)

this work properly .. I want to do the same thing with numeric field

I can use this but only for one field
MyDBBindingSource.Filter = "phone_number= " & CInt(TextBox1.Text)

I searched but didn't get any solition
please help me :(
 
my code :
MyDBBindingSource.Filter = String.Format("job LIKE '{0}%' Or address LIKE '{0}%' Or Fname LIKE '{0}%'", TextBox1.Text)

this work properly .. I want to do the same thing with numeric field

I can use this but only for one fieldMyDBBindingSource.Filter = "phone_number= " & CInt(TextBox1.Text)

Hi,

I am not sure what you mean here since you have already demonstrated that you know how to use the OR conditional statement and the String.Format Method. So, what's the problem you are having?

Cheers,

Ian
 
Back
Top