I'm currently writing a C#-class in my ASP.NET (3.5) application to handle all database-queries. Some of the methods are there to make a select-query to the database. Inside the method i simply have a SqlDataReader r = command.ExecuteReader();
to fetch the data.
I now want r
to be returned by the method, but when i close the database-connection, the datareader closes and the object contains nothing anymore. Thought of putting everything into a string-array, but this is unpractical if i have mixed integer and text-fields in my database. Is there an easy ("premade") way of storing the data in some object to return?