当前位置:编程学习 > C#/ASP.NET >>

求高手!!_keyTable = _connection.GetSchema("Foreign Key Columns");运行30秒后出现超时

我用的是Mysql数据库,在读取表的架构时如果运行超过30秒就出出现超时错误;
               _connection.Open();
                Console.WriteLine("开始:"+DateTime.Now );
                dt = DateTime.Now;
                _keyTable = _connection.GetSchema("Foreign Key Columns");
当运行 _keyTable = _connection.GetSchema("Foreign Key Columns");超过30秒后就会出现超时错误;
错误信息:Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
网上查了些资料:SqlCommand.CommandTimeout
获取或设置在终止执行命令的尝试并生成错误之前的等待时间。
等待命令执行的时间(以秒为单位)。默认为 30 秒。
对于GetSchema()方法怎样改变它的时间;
求高手
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,