Results 1 to 3 of 3

Thread: IndexOf Datarow?!?

  1. #1

    Thread Starter
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314

    IndexOf Datarow?!?

    I think I am going crazy..... is it not in anyway possible to get the index of a specific row in a table?

    I use soemthing like dr = Dataset11.Employees.FindByEmployeeID(4) to return a datarow from the Employees table of the Northwind database. I get a nice datarow object in my dr variable but......

    how on earth do I get the index of the row in that table, ie what position does that row have in the Employees table?!?

  2. #2
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    While the DataRow object does have a property called rowid, and it can be examined in the debugger at runtime and seems to contain a 1-2-3-4 type count of rows, the property is not exposed to you at build time. There is probably a way to get at that value but I suspect you'd have to customize/modify the DataRow object to do it (I don't have the faintest). You're not the first person to ask about this either.

  3. #3

    Thread Starter
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    ok, well I'm using a loop now, but that just seemed a little to much. I thought of building an modified DataRow class, but with a typed Dataset and so much computer generated code it kinda scared med off.

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