有人能告訴我這兩個代碼段的區別嗎?爲什麼使用IDataReader?c#IDataReader SqlDataReader的區別
using (IDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
// get data from the reader
}
}
using (SqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
// get data from the reader
}
}
偉大的答案,你打我吧:) – mdm 2011-05-26 10:56:08