View Single Post
  #3 (permalink)  
Old March 18th, 2007, 01:51 AM
nesrine nesrine is offline
Authorized User
 
Join Date: Feb 2007
Location: , , .
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What about the following, this is answering you question, cheers

 Dim ds As New Data.DataSet
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim con As New SqlClient.SqlConnection("data source=Nesrine;initial catalog=ASPNETDB;integrated security=true")

        Dim da As New SqlClient.SqlDataAdapter("select ContactId,Title,EmailAddress,FirstName,LastName from Person.Contact", con)

        da.Fill(ds)
        Me.DataGridView1.DataSource = ds.Tables(0)


    End Sub