Listing data from Database

M-RaH

Active member
Joined
Feb 9, 2006
Messages
25
Location
Netherlands
Programming Experience
Beginner
:eek: Hi,

I have a question i want to ask.

I have made a form where i can input a "name" to search in the database.. It is possible that there are many persons with the same name right,

i can't figure what is the best way to show a list from the database with all the persons with that "name" in another form ....

Thanx ;)
 
Just configure you SQL command to retrieve all the people with that name. For example...

VB.NET:
SELECT * FROM TableName WHERE name = ?
add the parameters to hold the value. Fot example if your using OleDb.

VB.NET:
OleDbCommand.Parameters.add("@name",oledbtype.varwchar,255,"name").value = the textbox with the employees name
 
Vis781,

I want to thank you for the info ... But the code wasn't the problem ... For example should i get the info from the database in a lable, textbox, o.e. ??? In a single lable ?? Or do i need 1 lable per name ??

or can i just put a datatable on the form .. with all the persons with the name ??
 
You can do this just about anyway you like.....

A datagrid will give a tablestyle representation of your data.
You could use a listbox.

My advice would be to use a datagrid.
 
Back
Top