I'm adapting some code that someone else wrote and need to return a DataTable for time's sake.
I have code like this:
using (SqlCommand command = new SqlCommand(query, conn))
{
//add parameters and their values
using (SqlDataReader dr = command.ExecuteReader())
{
return dr;
}
But what's the best way to return a datatable?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…