dummyagain
July 26th, 2006, 11:48 AM
I want to make a table that load all the data from the datebase such as name, age and sex.
I would like to use vb to load all the data and the table size will be determined by the number of data.
Can anybody help?
Thank you
superuser
July 28th, 2006, 07:18 PM
Here is a VB.net method that populates a gridview from a sql server database:)
Public Sub PopulateGridView1()
Dim conn As System.Data.SqlClient.SqlConnection = New System.Data.SqlClient.SqlConnection("Data Source=servername;Initial Catalog=database;Persist Security Info=True;User ID=user;Password=password")
Dim sqlStr As String = "SELECT * FROM t_prime"
Dim da As System.Data.SqlClient.SqlDataAdapter = New System.Data.SqlClient.SqlDataAdapter(sqlStr, conn)
Dim ds As New Data.DataSet
da.Fill(ds, "t_prime")
GridView1.DataSource = ds
GridView1.DataBind()
End Sub