954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to print a list/table with data from a Database using SQL

I've my data in a Database. Using SQL,I need to print it on a list
For example,
My Table is: Teachers, and it has ID, Name and Phone#.
I need a button which shows all this data in a list. My first thought is with a DataGridView..

ID Name Phone
01 John 4444
02 George 9999
.
.

Any ideas how

GeorgeGVD
Newbie Poster
19 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
 

Hi,
You can use a GridView, ListView or a repeater control (for HTML) to do this. They can all be bound to the data extracted from the database. I normally extract the data into a dataTable and use the DataSource = dataTable method of the Grid,List or Repeater to connect the two.

The GridView is probably the easiest.

hericles
Practically a Posting Shark
823 posts since Nov 2007
Reputation Points: 136
Solved Threads: 166
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: