Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I ran a dataadapter fill on a dataset. the fill causes rows to be returned. How do I return the CURRENT row? What if I navigated to the 80th record or so... how do I return the current row object?
Posted
Fill returns the number of rows that were added to the dataset, not an array of rows. And, if the dataset was empty before you filled it, then there wasn't a current row. But it sounds like you might want to use a currencyManager with a dataview. Clarify what you're trying to do, and maybe post some code, and hopefully we'll have a better sense of how to help.

"It may be roundly asserted that human ingenuity cannot concoct a cipher which human ingenuity cannot resolve."

 

- Edgar Allan Poe, 1841

 

I long to accomplish great and noble tasks, but it is my chief duty to accomplish humble tasks as though they were great and noble. The world is moved along, not only by the mighty shoves of its heroes, but also by the aggregate of the tiny pushes of each honest worker.

 

- Helen Keller

  • *Experts*
Posted

To elaborate on ballistic's note, a DataAdapter fills a DataSet. Neither the DataAdapter nor DataSet have any kind of pointer to a "current" row. You can use a CurrencyManager (a form has this built-in, to support moving Prev/Next etc.).

 

What do you mean by "navigate to the 80th record"? If you're already using the form's BindingContext (the built-in currency manager) to navigate, you can set it's Position property to go to any row (row 0 is the first row). You can also read the Position property to get the current row.

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

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...