Results 1 to 2 of 2

Thread: Do you do fill a datagrid?

  1. #1

    Thread Starter
    Addicted Member MoE70's Avatar
    Join Date
    May 2006
    Posts
    185

    Do you do fill a datagrid?

    I've got a button that sends an sql query to the database it works but i don't know how to fill the datagrid with the results of that query

  2. #2
    Hyperactive Member wornways's Avatar
    Join Date
    Mar 2010
    Posts
    261

    Re: Do you do fill a datagrid?

    Have a look at the DataTable class and see if that helps:

    http://msdn.microsoft.com/en-us/libr...datatable.aspx

    Once you've populated the DataTable instance with the results of your SQL query, it's just a matter of binding the DataGridView instance to that:

    Code:
    MyGridView.DataSource = MyDataTable
    It will be automatically populated.
    In an effort to abolish the writing of "Spaghetti Code",
    some fools got together and invented Spaghetti Syntax.

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