在asp.net中用SqlDataReader
stringa;SqlConnectionConn=newSqlConnection(@"DataSource=B4DB56A28F4C433\CJASS;DataBas...
string a;
SqlConnection Conn = new SqlConnection(@"Data Source=B4DB56A28F4C433\CJASS;DataBase=MyBookShop;Uid=sa;Pwd=juesi");
SqlCommand cmd = new SqlCommand("select * from Users", Conn);
Conn.Open();
SqlDataReader d = new SqlDataReader();
d=cmd.ExecuteReader();
while (d.Read())
a = d.GetString(0);
d.Close();
Conn.close();
怎么提示Data.SqlClient.SqlDataReader”未定义构造函数?怎么解决呢? 展开
SqlConnection Conn = new SqlConnection(@"Data Source=B4DB56A28F4C433\CJASS;DataBase=MyBookShop;Uid=sa;Pwd=juesi");
SqlCommand cmd = new SqlCommand("select * from Users", Conn);
Conn.Open();
SqlDataReader d = new SqlDataReader();
d=cmd.ExecuteReader();
while (d.Read())
a = d.GetString(0);
d.Close();
Conn.close();
怎么提示Data.SqlClient.SqlDataReader”未定义构造函数?怎么解决呢? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询