为什么提示缺少using指令
到底却了什么呢?
------解决方案--------------------------------------------------------
using System.Data.SqlClient;
...
SqlDataReader rs = new Executereader();
------解决方案--------------------------------------------------------
(ExecuteReader不是对象,是个方法,所以不能new)这样做的:
SqlCommand command =
new SqlCommand(queryString, connection);
connection.Open();
SqlDataReader reader = command.ExecuteReader();
// Call Read before accessing data.
while (reader.Read())
{
Console.WriteLine(String.Format( "{0}, {1} ",
reader[0], reader[1]));
}
// Call Close when done reading.
reader.Close();
------解决方案--------------------------------------------------------
using System.Data.SqlClient;或者写全System.Data.SqlClient.SqlDataReader
------解决方案--------------------------------------------------------
Executereader 是什么? 是你自己的类吗?如果是要写名称空间.