c/s架构 mysql数据库 局域网内 winforms登陆 执行
//读取数据 报错
MySQLDataReader DBReader = DBComm.ExecuteReaderEx(); 报错:System.ArgumentException: The structure must not be a value class.
Parameter name: structure 我在本机执行正常,在局域网其他机器上执行.exe就报错。
是不是需要配置mysql 支持局域网读取?我用的mysql4.1
// 建立数据库连接
MySQLConnection DBConn;
DBConn = new MySQLConnection(new MySQLConnectionString("localhost", "mysql", "root", "", 3306).AsString);
DBConn.Open();// 执行查询语句
MySQLCommand DBComm;
DBComm = new MySQLCommand("select Host,User from user", DBConn);// 读取数据
MySQLDataReader DBReader = DBComm.ExecuteReaderEx();// 显示数据
try
{
while (DBReader.Read())
{
//
}
}
finally
{
DBReader.Close();
DBConn.Close();
}//关闭数据库连接
DBConn.Close();
//读取数据 报错
MySQLDataReader DBReader = DBComm.ExecuteReaderEx(); 报错:System.ArgumentException: The structure must not be a value class.
Parameter name: structure 我在本机执行正常,在局域网其他机器上执行.exe就报错。
是不是需要配置mysql 支持局域网读取?我用的mysql4.1
// 建立数据库连接
MySQLConnection DBConn;
DBConn = new MySQLConnection(new MySQLConnectionString("localhost", "mysql", "root", "", 3306).AsString);
DBConn.Open();// 执行查询语句
MySQLCommand DBComm;
DBComm = new MySQLCommand("select Host,User from user", DBConn);// 读取数据
MySQLDataReader DBReader = DBComm.ExecuteReaderEx();// 显示数据
try
{
while (DBReader.Read())
{
//
}
}
finally
{
DBReader.Close();
DBConn.Close();
}//关闭数据库连接
DBConn.Close();
不是c# 问题, 可能是mysql配置问题