Link to home
Create AccountLog in
Avatar of VBdotnet2005
VBdotnet2005Flag for United States of America

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
ASKER CERTIFIED SOLUTION
Avatar of razorback041
razorback041
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
forgot to change the example to your names..sorry
Avatar of JRossi1
JRossi1

Or, using the Microsoft Data Access Application block...

Dim DS as New Dataset

SqlHelper.FillDataset(ConnectionString, CommandType.Text, "SELECT * FROM urTable", DS, New String() {"Table Name"})
Me.datagrid1.DataSource = DS
Me.datagrid1.DataMember = "Exceptions"