MYSQL高手进,存储过程问题(高分)

来源:百度知道 编辑:UC知道 时间:2024/06/06 19:47:08
c#调用mysql存储过程,c#代码是从网上找的应该没问题,存储过程在NAVICAT里执行也没问题。可用C#调用存储过程就报错 exception during execution of 'SearchOid':procedure SearchOid does not exist
再试我又在c#程序里的存储过程名前加上了数据库名 localhost.SearchOid 报这个错Invalid attempt to access a field before calling Read() 谁知道怎么回事,感谢万分啊!!!

if(reader.HasRows)
{
reader.Read();
String res=reader.GetString(0);
}
如此调用MySqlDataReader,必须先判断是否有Row,然后Read(),否则都会返回错误:
Invalid attempt to access a field before calling Read()

不了解,学习中....