VBdotnet2005
asked on
fill datagrid
i am working on VB.NET windows application.
In my windows form i have a one Datagrid
I want to fill this datagrid from my database, called "Sample1". How can I accomplish this task? I created data connection in Server Explorer. Sample1.dbo - Tables ---> Addresses
In my windows form i have a one Datagrid
I want to fill this datagrid from my database, called "Sample1". How can I accomplish this task? I created data connection in Server Explorer. Sample1.dbo - Tables ---> Addresses
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
forgot to change the example to your names..sorry
Or, using the Microsoft Data Access Application block...
Dim DS as New Dataset
SqlHelper.FillDataset(Conn ectionStri ng, CommandType.Text, "SELECT * FROM urTable", DS, New String() {"Table Name"})
Me.datagrid1.DataSource = DS
Me.datagrid1.DataMember = "Exceptions"
Dim DS as New Dataset
SqlHelper.FillDataset(Conn
Me.datagrid1.DataSource = DS
Me.datagrid1.DataMember = "Exceptions"