Click here to Skip to main content
16,020,811 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
this is my code


Select Case Me.Text

Case "Suppliers Management"
If Me.cboSearch.Text = "Supplier ID" Then

xSQL = "SELECT * FROM suppliers WHERE SuppliersID LIKE '" & Me.txtSearch.Text & "'"
LoadSuppliers(xSQL)


the result of that search would display in the listview what I want is that if there is no value for what I'm searching for then a prompt message would display that error no display how am I going to do that?
Posted

1 solution

Are you asking us to give you all of the code to do that?

Hopefully not, because that's probably not going to happen. But we can give you some tips and pseudo-code.

You'll want to use ADO.NET first. There are many different types, but the SqlAdapter will probably be your best bet. You can use the SqlDataReader class to get the results of your query. Then, pull out the information you need and display it in the ListView. Also, if you're using the LIKE keyword, don't you want to include wildcards? Or is your txtSearch already written with the wildcards?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900