您的位置:首页 > 数据库 > MySQL

探索MySql.Data.dll

2007-12-30 10:52 561 查看
ADO.NET Driver for MySQL

MySql.Data.dll是.Net访问MySQL数据库的一个驱动,完全ADO.NET数据访问模式,由MySQL官方提供,有多个版本可选择。

最早使用的环境:.Net2.0+MySQL5.x+MySQL.data.dll 1.0.7,感觉似乎很稳定,一直没什么大问题。随着系统升级,尝试更新MySql.Data.dll版本(1.07版本官方早不提供下载了,现在最新版本分别是:1.0.10,5.0.8,5.1.4),问题出现了,经常会出现异常

The timeout period elapsed prior to completion of the operation or the server is not responding
在业务逻辑及数据不变的情况下,仅更换MySql.Data.dll就出现异常让我费尽了心思。[Category("Connection")]

[Description("Number of seconds to wait for the connection to succeed")]

[DefaultValue(15)]

public int ConnectionTimeout

[Category("Misc")]

[Description("Time to wait for command to execute")]

public int CommandTimeout

[Category("Connection")]

[DisplayName("Connect Timeout")]

[Description("The length of time (in seconds) to wait for a connection " +

"to the server before terminating the attempt and generating an error.")]

[DefaultValue(15)]

[RefreshProperties(RefreshProperties.All)]

public uint ConnectionTimeout

[Category("Misc")]

[Description("Time to wait for command to execute")]

[DefaultValue(30)]

public override int CommandTimeout

{

{ return commandTimeout; }

{ commandTimeout = value; }

}
属性可读写,默认值为30秒(这些默认值感觉跟SQLServer一样的),这一点跟1.0.7就不同了。1.0.7为只读且值为0。

我感觉前面提到的Timeout异常跟这里有很大关系,准备测试下.......

PS:希望能在园子里找些用MySQL的朋友,有问题可以一起探讨,在社区建了个小组: .Net+MySQL
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: