Results 1 to 6 of 6

Thread: Help with Terminology Please

  1. #1

    Thread Starter
    Hyperactive Member Jonny1409's Avatar
    Join Date
    Mar 2005
    Posts
    308

    Help with Terminology Please

    Hello,

    I have been given a task to do and I am struggling to understand fully and was wondering if any of you could hlep explain it to me please ?

    I need to bind data from an access database to a datagridview. (the DB simply holds a list of product with their stock code, desription etc)

    I need to bind this datagridview to a products collection without using a dataset to bind to the datagridview.

    I really don't understand this fully. Can anyone explain what it means

    Thanks.

  2. #2
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: Help with Terminology Please

    Use a DataTable maybe?
    On the other hand, you could always ask the person that gave you the specs to clarify what he/she means.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  3. #3

    Thread Starter
    Hyperactive Member Jonny1409's Avatar
    Join Date
    Mar 2005
    Posts
    308

    Re: Help with Terminology Please

    Thanks Stanav - I would ask for clarification but it's for a test so I can't really.

    I'm happy to do the work I simply want to make sure I fully understand what is meant by "binding a datagridview to a collection without using a dataset"

    I have created a products class and created properties for ID, Stock Code and Description.

    If I wasn't linking to an Access DB I could create a new collection, and populate the collection on the form load event manually e.g. :
    Code:
    Dim m_Products As Collection
    m_Products = New Collection
    m_Products .Add(New Products ("1", "0001", "Bicycle"))
    m_Products .Add(New Products ("2", "0002", "Car"))
    m_Products .Add(New Products ("3", "0003", "Bus"))
    DataGridView1.DataSource = m_Products
    However, I'm not sure where the connection to Access fits in.
    Also, I'm not sure if the above is even right.

  4. #4
    Fanatic Member Megalith's Avatar
    Join Date
    Oct 2006
    Location
    Secret location in the UK
    Posts
    879

    Re: Help with Terminology Please

    that is not a well phrased question, strictly a dataset is a method of storing data therefore a datatable, datareader or a datasource are forms of dataset, also it is not clear what kind of binding is expected(early or late) i really would ask for clarification or you could be completely wrong with the test
    If debugging is the process of removing bugs, then programming must be the process of putting them in.

  5. #5
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: Help with Terminology Please

    I think what that person means is to create your own class to represent a product. You then create a collection of this class (such as a List(Of Product) for example. Using a datareader, you connect to your DB to read the product table and populate your collection. Once done, you bind that collection to the DGV.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  6. #6
    Fanatic Member Megalith's Avatar
    Join Date
    Oct 2006
    Location
    Secret location in the UK
    Posts
    879

    Re: Help with Terminology Please

    oh i see, read the data put it in a list and then bind to the list to populate the dgv. for sure i'd use datasource to display the results and it looks like jonny1409 is kinda going down the right road but needs to put them adds in a class that parses the data
    If debugging is the process of removing bugs, then programming must be the process of putting them in.

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