使用asp.net访问mysql数据库时出错 [英] error while acessing mysql database with asp.net

查看:143
本文介绍了使用asp.net访问mysql数据库时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 MySql.Data.MySqlClient.MySqlException被捕获
消息= 超时已过期。操作完成前经过的超时时间或服务器没有响应。
Source = MySql.Data
ErrorCode = -2147467259
Number = 0
StackTrace:
at MySql.Data.MySqlClient.ExceptionInterceptor.Throw (异常异常)
at MySql.Data.MySqlClient.MySqlConnection.Throw(Exception ex)
at MySql.Data.MySqlClient.MySqlConnection.HandleTimeoutOrThreadAbort(Exception ex)
at MySql.Data.MySqlClient .MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
at frmregistration.btnsavenew_Click(Object sender,EventArgs e) in d:\ crm \ frmregistration.aspx.cs:line 861
InnerException:System.TimeoutException
Message = 连接尝试失败,因为连接方在一段时间后没有正确响应,或者建立的连接失败,因为连接的主机无法响应
Source = MySql.Data
StackTrace:
at MySql.Data.Common.MyNetworkStream.HandleOrRethrowException(Exception e )MySql.Data.Common.MyNetworkStream上的
读取(Byte []缓冲区,Int32偏移量,Int32计数)
at MySql.Data。 MySqlClient.TimedStream。读取(Byte []缓冲区,Int32偏移量,Int32计数)
在System.IO.BufferedStream。读取(Byte []数组,Int32偏移量,Int32计数)
at MySql.Data.MySqlCli ent.MySqlStream.ReadFully(Stream stream,Byte [] buffer,Int32 offset,Int32 count)
at MySql.Data.MySqlClient.MySqlStream.LoadPacket()
at MySql.Data.MySqlClient.MySqlStream.ReadPacket ()
at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow,Int32& insertedId)
at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId,Int32& affectedRows,Int32& insertedId)
at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId,Boolean force)
at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
InnerException:System.IO.IOException
Message = 无法从传输连接读取数据:连接尝试失败,因为连接方在一段时间后没有正确响应时间或建立的连接失败,因为连接的主机无法响应。
Source = 系统
StackTrace:
在System.Net.Sockets.NetworkStream。读(Byte [] buffer,Int32 offset,Int32 size)
at MySql.Data.Common.MyNetworkStream。 Read (Byte [] buffer,Int32 offset ,Int32 count)
InnerException:System.Net.Sockets.SocketException
Message = 一个连接尝试失败,因为连接方在一段时间后没有正确响应,或者建立的连接失败,因为连接的主机未能响应
Source = 系统
ErrorCode = 10060
NativeErrorCode = 10060
StackTrace:System.Net.Sockets上的
。 Socket.Receive(Byte []缓冲区,Int32偏移量,Int32大小,SocketFlags socketFlags)
在System.Net.Sockets.NetworkStream。读取(Byte []缓冲,Int32 offset,Int32 size)
InnerException:



请帮助解决此错误。

解决方案

< blockquote>超时到期你的SQL连接相关问题',一旦签出连接字符串,如果连接字符串工作正常,那么在sQL服务器端执行SQL表请花多少时间执行请结账这个...

如果表执行需要更多时间,那么你联系你的数据库团队来解决这个问题


MySql.Data.MySqlClient.MySqlException was caught
  Message="Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding."
  Source="MySql.Data"
  ErrorCode=-2147467259
  Number=0
  StackTrace:
       at MySql.Data.MySqlClient.ExceptionInterceptor.Throw(Exception exception)
       at MySql.Data.MySqlClient.MySqlConnection.Throw(Exception ex)
       at MySql.Data.MySqlClient.MySqlConnection.HandleTimeoutOrThreadAbort(Exception ex)
       at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
       at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
       at frmregistration.btnsavenew_Click(Object sender, EventArgs e) in d:\crm\frmregistration.aspx.cs:line 861
  InnerException: System.TimeoutException
       Message="A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"
       Source="MySql.Data"
       StackTrace:
            at MySql.Data.Common.MyNetworkStream.HandleOrRethrowException(Exception e)
            at MySql.Data.Common.MyNetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count)
            at MySql.Data.MySqlClient.TimedStream.Read(Byte[] buffer, Int32 offset, Int32 count)
            at System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32 count)
            at MySql.Data.MySqlClient.MySqlStream.ReadFully(Stream stream, Byte[] buffer, Int32 offset, Int32 count)
            at MySql.Data.MySqlClient.MySqlStream.LoadPacket()
            at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
            at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId)
            at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId)
            at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
            at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
            at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
       InnerException: System.IO.IOException
            Message="Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond."
            Source="System"
            StackTrace:
                 at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
                 at MySql.Data.Common.MyNetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count)
            InnerException: System.Net.Sockets.SocketException
                 Message="A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"
                 Source="System"
                 ErrorCode=10060
                 NativeErrorCode=10060
                 StackTrace:
                      at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
                      at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
                 InnerException: 


please help to resolve this error.

解决方案

Timeout expiration in the sense your SQL connection related issue''s , once checkout the connection string , if the connection string is working fine , then execute the SQL table in sQL server side how much time it''s taking for execution please checkout this...
If the table execution takes more time then you contact to your DB team to resolve this issue


这篇关于使用asp.net访问mysql数据库时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆