Diesel Posted July 26, 2004 Posted July 26, 2004 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? Quote
Administrators PlausiblyDamp Posted July 26, 2004 Administrators Posted July 26, 2004 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
JABE Posted July 27, 2004 Posted July 27, 2004 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. Quote
Diesel Posted July 27, 2004 Author Posted July 27, 2004 Thanks Im going to use an arraylist of the objects that my program uses...thanks...I thought an XML stream was pretty verbose though? Quote
JABE Posted July 27, 2004 Posted July 27, 2004 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.