1 Replies - 604 Views - Last Post: 26 January 2013 - 04:02 AM Rate Topic: -----

#1 voljin099  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 24-January 13

SQL server database on listbox in VB10

Posted 25 January 2013 - 11:51 PM

Hello there! I'm a newbie in VB10 I would like to ask 'how to insert my data in SQL server to Listbox in VB10'
I managed to insert,delete, and even update the data in SQL SERVER my only problem is how to make a search function so that if I want to search a specific data on my DB it will appear on ListBox. I do this because I want to avoid using datagrid and connecting the datasource on it.

BTW I do the INSERT,UPDATE,DELETE by using one textbox and one button...
Is This A Good Question/Topic? 0
  • +

Replies To: SQL server database on listbox in VB10

#2 andrewsw  Icon User is offline

  • say what now
  • member icon

Reputation: 6410
  • View blog
  • Posts: 25,908
  • Joined: 12-December 12

Re: SQL server database on listbox in VB10

Posted 26 January 2013 - 04:02 AM

You haven't mentioned the fourth, most important, keyword: SELECT

Dim cmd as New SqlCommand("SELECT field1, field2 FROM table1 WHERE field1 LIKE @searchterm"

cmd.Parameters.Add("@searchterm", searchString +"%")


Once you've got the data you could loop through the data adding items to the list box.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1