navaneet31
New member
- Joined
- Sep 4, 2014
- Messages
- 2
- Programming Experience
- Beginner
I made a tool for a realestate company i have done everything fine i got an issue with a search option.Let me explain.
In my database i have a column called quoted_amount, In that column each column contains like below.
5
6
9
10
44
556
78
23
What i need exactly is when i type a number 10 in search box it need to show all the rows that having quoted_amount less than or equal to 10 .
Thanks what code i suppose to write for it.
I have used the following search function for searching names and phonenumber ,But for number i failed to write code please help.
VB.NET:
If typesearch.Text = "" Then MsgBox("Please select type of search ")
End If
cnn = New OleDb.OleDbConnection
cnn.ConnectionString = "Provider=Microsoft.Jet.Oledb.4.0; Data Source=" & Application.StartupPath & "\data.mdb"
cnn.Open()
Dim dt As New DataTable
Dim ds As New DataSet
ds.Tables.Add(dt)
Dim da As New OleDbDataAdapter
If typesearch.Text = "Contact Number" Then
da = New OleDbDataAdapter("select * from Buyer_Data where Primary_Conno like '%" & searchbox.Text & "%'", cnn)
ElseIf typesearch.Text = "Name" Then
da = New OleDbDataAdapter("select * from Buyer_Data where cust_name like '%" & searchbox.Text & "%'", cnn)
Else
da = New OleDbDataAdapter("select * from Buyer_Data where Email_Address like '%" & searchbox.Text & "%'", cnn)
End If
da.Fill(dt)
dgvData.DataSource = dt.DefaultView
cnn.Close()