Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB.net Win Form & SQL 2002

Status
Not open for further replies.

Domino2006

Programmer
Jan 13, 2007
20
0
0
GB
Hi Guys and Girls im writting an application for an sql database, i have a windows form and want to list all the primary keys from the sql database in either a list box or another control, i would like to be able to doublw click the primary key in the list box and for it to retrieve that particular dataset from the server i have all the relevant connections and datasets created. Any Help Would Be Gr8fully appretiated.

Domino2006
 
Hi and welcome to the forum.

Looks like to me as an assignment... anyway.

First, have a search here or anywhere in the internet. You will see how to send a query and fill a datatable and then bind it to a control, or read through it (the datatable) and add each item to a control, or even using a datareader to do almost the same thing.

If it is a listbox, then using the .text property in the selectedIndexChanged event handler you can get the selected text.... which will be a parameter (or use string.format()) in a WHERE clause..


That's all for now.
Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top