日期:2014-05-17  浏览次数:20481 次

数据库连接登录,老提示对象名Employee无效
string strsql = "select E_Password from Employee where E_No ='" + this.TextBox1.Text + "'and E_Password ='" + this.TextBox2.Text + "'";
  SqlCommand cmd = new SqlCommand(strsql, con);
  DataSet ds = new DataSet();
  SqlDataReader dr = cmd.ExecuteReader();

------解决方案--------------------
表名Employee存在吗?表名写错了吧
------解决方案--------------------
是不是你连的库不对呀??? 确定连接的库中含有Employee表
------解决方案--------------------
以上差不多把情况都说出来了 回帖拿10分可用分
------解决方案--------------------
1是看看数据库中是否有Employee 表
2是看看表Employee是否写错