Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

It has been a while since I have done this. How do I navigate through a datatable and get the datarow number of the current record?

 

I thought that it would be something like this:

'go to first record

me.BindingContext(dsVeh.Tables("tblVeh").Position = 0

 

'go to next record

me.BindingContext(dsVeh.Tables("tblVeh").Position +=1

[\code]

 

That code is giving me an error though by saying Position is not a member of bindingcontext.

 

And I do not know how to get the current row number of the datatable, only the total count.

 

Thanks,

Chester

____________________________________________

http://www.pophamcafe.com

I am starting a developers section, more tutorials than anything.

Posted

Okay, I got that figured out now:

 

Me.BindingContext(dsVeh, "tblVeh").Position = _

(Me.BindingContext(dsVeh, "tblVeh").Position + 1)

 

But now how do I place the current information into the controls. I am not using databinding. I would like to have something like:

 

txtNumber = dsVeh.Tables("tblVeh").Rows(currenttRow).Columns(1).tostring,

 

But I can not find out how to do this. Anyone have any ideas?

 

Thanks, Chester

____________________________________________

http://www.pophamcafe.com

I am starting a developers section, more tutorials than anything.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...