MilantoMinsk
Member
- Joined
- May 2, 2014
- Messages
- 7
- Programming Experience
- Beginner
Searching SQL database
I am trying to write a code for searching a local SQL database for my desktop application (VS 2012). At this stage, all I want to do is check database for user inputted barcode. I made a simple parameterised query:
And this is code for a button:
Is this a good way to do it? Or is there maybe more efficient way? I am expecting for my database to have about three thousand items.
Thanks
I am trying to write a code for searching a local SQL database for my desktop application (VS 2012). At this stage, all I want to do is check database for user inputted barcode. I made a simple parameterised query:
SELECT ID, Name, Price, Barcode FROM ItemList WHERE (Barcode = @Barcode)
And this is code for a button:
Dim g As New Database1DataSet.ItemListDataTable If Me.ItemListTableAdapter.FillBy(g, (CInt(TextBox1.Text)) > 0 Then MsgBox("Item Found!") End If
Is this a good way to do it? Or is there maybe more efficient way? I am expecting for my database to have about three thousand items.
Thanks