异常详细信息: System.Data.SqlClient.SqlException: 对象名 'voteMaster1' 无效
源错误: 
行 19:         con.Open();
行 20:         SqlCommand cmd = new SqlCommand("select voteTile from voteMaster1 where voteID="+this.voteID, con);
行 21:         string title = Convert.ToString(cmd.ExecuteScalar());
行 22:         this.Label1.Text = title;
行 23: 
 
 
哪位告诉我哪里错了???

解决方案 »

  1.   

    行 19:         con.Open();
    行 20:         SqlCommand cmd = new SqlCommand("select 1 from northwind ", con);
    行 21:         string title = Convert.ToString(cmd.ExecuteScalar());
    行 22:         this.Label1.Text = title;
    行 23:
      

  2.   

    voteMaster1在数据库里面存在吗?
    voteMaster1是你数据库里面的一个表吗?
      

  3.   

    表voteMaster1?还是应该为表voteMaster?
      

  4.   

    voteMaster1是数据库名还是表名啊。sql语句里应该写的是表名!
      

  5.   

    确定你链接的那个数据库中存在voteMaster1表吗?