Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
Im looking for the simplest way to save rows from a database. What I do is perform a query using executereader inside of a function, but I cannot return an SqlDataReader from the function, because the connection to the database is closed within the function. Is there a row collection class? Should I just create a dataset and save the data in there? What is the most efficient way?
  • Administrators
Posted
Depends on what you are wanting to do to the rows later. A dataset is an easy way to return the information but it can be quite large in memory. You may want to just populate an array or a collection with the relevant data and return that.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted
XML format is also a good candidate; lightweight and non-proprietary. Again, boils down to what you intend to do w/ the result as noted by Plaus.
Posted

Thanks

 

Im going to use an arraylist of the objects that my program uses...thanks...I thought an XML stream was pretty verbose though?

Posted

I thought an XML stream was pretty verbose though?

 

True, but then again lightweight and non-proprietary. Ideal for cross-machine/cross-platform marshalling scenarios. But if you're not into those, then definitely no need for such verbosity.

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