CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2003
    Location
    Pakistan
    Posts
    3

    Little confusion!

    check this statement

    objTable.Rows(0).Item("name")

    this statement extract value of name column from the given DataTable object reference. Here Rows is DataTable propery which returns DataRowCollection but Item is a property of DataRow class so is it possible to return DataRow object refenrence from Rows property and use Item property.

    what i think it is doing is, it is using Item property of DataRowCollection class to get the required row and then using Item property of that returned row to get the value of column name. but again if it is so how is it happening be hind the scene.

    plz make me clear this concept

  2. #2
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868
    objTable.Rows(0).Item("name") is the same as

    Row = objTable.Rows(0)
    Item = row.Item("name")

  3. #3
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167
    Well, the ITEM in DATAROWCOLLECTION is type of DATAROW. So when you .ROWS(0), you're retrieving the DATAROW item from the DATAROWCOLLECTION.

    -Cool Bizs

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