Hello, I have just started using the Data Access Application Block from microsoft. There are very few instructions on the correct way to use the library. Just wanted to know if this is the correct way to use the data reader.
SqlDataReader reader = SqlHelper.ExecuteReader(config.ConnectionString, CommandType.Text, "select * from category");
List<string> a = new List<string>();
using (reader)
{
while (reader.Read())
{
string t = reader.GetString(1);
a.Add(t);
}
return a;
}
will everything get closed doing it this way? Is there any chance of memory leaks?