P
pinhead
Just a question on performance. I'm building an .Net2 web application.
At present we've got very few users and the web app flies along. All
the data access is performed through a DAL and most of the data is
return through DataTables. All code is in C# and all data access
without exception is in the following style:
<code>
private DataTable myDataTable()
{
using (SqlConnection conn = new SqlConnection(mySQLConnection))
{
DataTable dt = new DataTable();
SqlCommand cmd = new SqlCommand(mySp, conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
da.Fill(dt);
return dt;
}
}
</code>
Is this preferable over using DataSets? Or would I be better off using
DataReaders?
At present we've got very few users and the web app flies along. All
the data access is performed through a DAL and most of the data is
return through DataTables. All code is in C# and all data access
without exception is in the following style:
<code>
private DataTable myDataTable()
{
using (SqlConnection conn = new SqlConnection(mySQLConnection))
{
DataTable dt = new DataTable();
SqlCommand cmd = new SqlCommand(mySp, conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
da.Fill(dt);
return dt;
}
}
</code>
Is this preferable over using DataSets? Or would I be better off using
DataReaders?