Tuesday, February 20, 2007

Directly Binding Dataset with Datagrid View

With windows forms 2.0 you can directly bound the datagrid with dataset.

For example,

your dataset name is 'dt'

First fill your dataset with data.

Then select datagridview and create the columns and in the datamember property of each give the name of column you want to bind.

just write the following code.

For example you datagrid code is dg

dg.DataSource=dt;
dg.Refresh();

That's it you have bound the datagrid with dataset
Share:

0 comments:

Post a Comment

Your feedback is very important to me. Please provide your feedback via putting comments.

Support this blog-Buy me a coffee

Buy me a coffeeBuy me a coffee
Search This Blog
Subscribe to my blog

  

My Mvp Profile
Follow us on facebook
Blog Archive
Total Pageviews