c/s架构 mysql数据库 局域网内 winforms登陆执行MySQLDataReader DBReader = commn.ExecuteReaderEx();
报:System.ArgumentException: The structure must not be a value class.
Parameter name: structurestring sql = "select 操作员密码 from operatorinfo where 操作员代码 ='" + userlogin + "'";
MySQLConnection conn = null;
conn = new MySQLConnection(new MySQLConnectionString("220.34.182.226", "db32", "root", "").AsString);
conn.Open();
MySQLCommand commn = new MySQLCommand(sql, conn);
commn.ExecuteNonQuery();
MySQLDataReader DBReader = commn.ExecuteReaderEx();
MySQLDataAdapter mda = new MySQLDataAdapter(sql, conn);
DataSet ds = new DataSet();
mda.Fill(ds, "table1");
if (DBReader.Read())
{
if (psdlogin == DBReader["操作员密码"].ToString().Trim())
{
this.Hide();
LoginForm lg = new LoginForm();
lg.Show();
}
else
{
MessageBox.Show(" 操作员密码不正确! ", "系统提示");
conn.Close();
}
}
else
{
MessageBox.Show(" 没有此操作员,请重新输入! ", "系统提示");
}
conn.Close();
DBReader.Close();
报:System.ArgumentException: The structure must not be a value class.
Parameter name: structurestring sql = "select 操作员密码 from operatorinfo where 操作员代码 ='" + userlogin + "'";
MySQLConnection conn = null;
conn = new MySQLConnection(new MySQLConnectionString("220.34.182.226", "db32", "root", "").AsString);
conn.Open();
MySQLCommand commn = new MySQLCommand(sql, conn);
commn.ExecuteNonQuery();
MySQLDataReader DBReader = commn.ExecuteReaderEx();
MySQLDataAdapter mda = new MySQLDataAdapter(sql, conn);
DataSet ds = new DataSet();
mda.Fill(ds, "table1");
if (DBReader.Read())
{
if (psdlogin == DBReader["操作员密码"].ToString().Trim())
{
this.Hide();
LoginForm lg = new LoginForm();
lg.Show();
}
else
{
MessageBox.Show(" 操作员密码不正确! ", "系统提示");
conn.Close();
}
}
else
{
MessageBox.Show(" 没有此操作员,请重新输入! ", "系统提示");
}
conn.Close();
DBReader.Close();
DataSet ds = new DataSet();
mda.Fill(ds, "table1");
{
...
}试试这个