mysqlcommand.CommandText = "select * from student where AccountNumber=" + student + "";
改为:
mysqlcommand.CommandText = "select * from student where AccountNumber=" + student ;
你这是SQL语句拼接错误。如果strdent是String类型的话还要用单引号引起来:
mysqlcommand.CommandText = "select * from student where AccountNumber=" + "'"+student+"'" ;
AccountNumber是不是数字型的话,要用单引号引起来,
mysqlcommand.CommandText = "select * from student where AccountNumber='" + student + "'";
mysqlcommand.CommandText ='"select * from student where AccountNumber='" + student + "'";
如果还错误的话把输入法换成英文的,再把所有的=重打一次。
应该是你的查询语句错了,"select * from student where AccountNumber=" + student + "";那个student是个啥子控键?加.text属性试试。