Results 1 to 2 of 2

Thread: how to view dataset contents to datagridview?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2006
    Posts
    73

    how to view dataset contents to datagridview?

    Hi,

    I have a datagridview and a dataset. How can I possibly view the contents of dataset to the datagridview??

    is this statement enough:

    Code:
    datagridview1.datasource = dataset1;
    datagridview1.show();
    appriciate your assistance..

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: how to view dataset contents to datagridview?

    You either assign the DataTable to the DataSource or the DataSet to the DataSource and the name of the table to the DataMember.
    Code:
    myDataGridView.DataSource = myDataSet.Tables("MyTable")
    Code:
    myDataGridView.DataMember = "MyTable"
    myDataGridView.DataSource = myDataSet
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width