CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Datagid binding

  1. #1
    Join Date
    Jul 2007
    Posts
    28

    Datagid binding

    I bound a datagrid to a datatable from a dataset (from oleDbDataAdapter) using datasource and datamember properties but only the fields appear as headings but the data is not there. When I check the oleDataAdapter preview it appears there though. How do I fill the datagrid with the data?

  2. #2
    Join Date
    Dec 2005
    Location
    Waterloo ON
    Posts
    545

    Re: Datagid binding

    No source code here, so no idea how you did it. Please post source code if you want.
    The difficulty is that you have no idea how difficult it is.

    .Net 3.5/VS 2008

  3. #3
    Join Date
    Jul 2007
    Posts
    28

    Unhappy Re: Datagid binding

    Do you always say "The difficulty is that you have no idea how difficult it is"? True, but I think I know how difficult it is. The reason I did not include source code is that there is none. I used data connection wizard and also set databinding properties of datagridview at design time as I explained - no code - and the reason for this is I needed to see how this ADO thing works before I jump into blind code-writing. What I need to know is just one line of code to fill my datagrid with the data - is it too much too ask?
    Perhaps something like oledataAdapter.fill...... in the Form_Load event or something?
    Please dont give me a link to some sample that will not work because I spend days trying to fix up bad sample code.
    I'm in a tedious learning stage of a lot of things - with this OOPs thing in vb.net - new to it -too many classes and stuff when do you get to attend all of them - I think I'm cracking. Please help with this.

  4. #4
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Datagid binding

    You need to fill the dataset before you can see the dataset. Do it in the Form Load event handler and you should be good.

    It always helps to mention which version you are using.

  5. #5
    Join Date
    Jul 2007
    Posts
    28

    Re: Datagid binding

    Resolved. I was looking for the fill method of oledbdataAdapter.

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

Featured