返回结果为空,以下是我的代码:
string strConn = "Driver={MySQL ODBC 5.1 Driver};server=localhost;Port=3306;User=root;Password=chenhao;database=hbrc";
OdbcConnection conn = new OdbcConnection(strConn);
OdbcCommand com = new OdbcCommand();
com.Connection = conn;
com.CommandType = CommandType.StoredProcedure;
com.CommandText = "call prLoginUser(@x,@y)";
OdbcParameter para = new OdbcParameter("@x", OdbcType.VarChar);
para.Value = userName;
com.Parameters.Add(para);
para = new OdbcParameter("@y", OdbcType.VarChar);
para.Value = password;
com.Parameters.Add(para);
OdbcDataAdapter ada = new OdbcDataAdapter(com);
DataSet ds = new DataSet();
ada.Fill(ds,"UserInfo");
ds结果是空的不知道为什么?
但直接在MySql服务器里调用是有值的,下面是图