易截截图软件、单文件、免安装、纯绿色、仅160KB

C#中调用mysql存储过程出现的问题

在root账号中,可以正常调用存储过程.
换到common_user账号时,同一存储过程名调用出现问题.
追踪调试时出现:
SELECT command denied to user 'common_user'@'localhost' for table 'proc'
搜索解决方案:
MySqlConnection myconnection = new MySqlConnection("server=localhost;user id=common_user; password=***;database=testdb; Use Procedure Bodies=false;Charset=utf8;");

关键语句是:
Use Procedure Bodies=false;
在网上搜索本句含义:
Name : Use Procedure Bodies 
Default : true 
Description : Setting this option to false indicates that the user connecting to the database does not have the SELECT privileges for the mysql.proc (stored procedures) table. When to set to false, Connector/NET will not rely on this information being available when the procedure is called. Because Connector/NET will be unable to determine this information, you should explicitly set the types of the all the parameters before the call and the parameters should be added to the command in the exact same order as they appear in the procedure definition. This option was added in Connector/NET 5.0.4 and Connector/NET 1.0.10. 
 大体意思是说:
当设置时use procedure bodies=false,存储过程的参数需要与程序里的参数顺序一致.
还未结束.
在mysql官方.给出了这样设置会有一个BUG.
http://bugs.mysql.com/bug.php?id=36694
当然这样解决的办法还是有的.可以使用ODBC连接来实现.
这里不再详细说明.
附上.NET连接mysql的连接字符串网址(比较全面的连接归类):
http://www.connectionstrings.com/mysql


相关文档:

C#与Flash交互

C#与Flash交互 (转自小磊在线)
C#与Flash交互
前段日子公司要求做一个C#与Flash交互的东西,用来C#与短信猫通讯将数据传到Flash上显示与操作的应用。
第一步C#添加组件
打开VS2005-工具-选择工具箱项-COM组件-选择Shockwave Flash Object-确定
添加好组件往场景上拖放,如果提示注册需求注册
c# 注册控件-在运行输 ......

C# Xml中映射为类数据结构(报文)

        [System.Runtime.Serialization.DataMemberAttribute()]
        public Information Archive {
            get {
         &n ......

"序列化" Serializable 理解 (asp.net C#)

 比如用一个类描述一张合同,而这个类实例化后其中的字段保存着合同的信息,如果现在要把这个类的实例发送到另一台机器、另一个窗体或是想保存这个类以便以后再取出来用(持久化对象),可以对这个类进行序列化(序列化实际上是一个信息流),传送或保存,用的时候再反序列化重新生成这个对象
为什么您想要使用序列化 ......

解决mysql客户端乱码

通常我习惯将mysql数据库设置默认编码为utf-8,这就有一个问题,在windows客户端中中文显示乱码,因为windows默认编码为gb2312或ansi。多方查找终于解决,在windows客户端登入mysql
输入
set NAMES GB2312;
小命令,大作用啊。 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号