Question How to write SQL Statement?

Adrian87

Member
Joined
Aug 13, 2009
Messages
13
Programming Experience
Beginner
how to use the SQL statement to retrieve from database, without using wizard, how?
 
say that you want retrieve data from the table employees
VB.NET:
Dim connection As New SqlConnection("connectionstring")
Dim command As SqlCommand = connection.CreateCommand
command.CommandText = "SELECT * FROM employees"
Dim table as New DataTable
connection.Open
table.Load(command.ExecuteReader(CommandBehavior.CloseConnection))
Me.GridView1.DataSource = table
Me.GridView1.DataBind
 

Latest posts

Back
Top