问题如下:
var connectionString = "";
string queryString ="select * from KP_ITEM";
using (SqlConnection connection =new SqlConnection(connectionString))
{
SqlCommand command =new SqlCommand(queryString, connection);
connection.Open();
SqlDataReader reader = command.ExecuteReader();
Stopwatch swatch = Stopwatch.StartNew();
reader.Close();
swatch.Stop();
Console.WriteLine("dr关闭,耗时{2} ms", swatch.ElapsedMilliseconds);
}
请各路大神不吝赐教,非常感谢!
http://www.cnblogs.com/eaglet/archive/2009/10/14/1582939.html
善用百毒