Click here to Skip to main content
15,944,401 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Comments
Sandeep Mewara 16-Feb-13 2:49am    
See if connection string is correct and server allows remote connections.
Member 8825505 16-Feb-13 2:53am    
str = "insert into registration values(" + txtsno.Text + ",'" + txtdate.Text + "','" + ddlgroup.SelectedItem + "','" + ddlbusiness.SelectedItem + "','" + txtvisit.Text + "','" + txtclient.Text + "','" + txtorg.Text + "','" + txtaddress1.Text + "','" + txtaddress2.Text + "','" + txtarea.Text + "','" + ddlcountry.SelectedItem + "','" + ddlstate.SelectedItem + "','" + ddlcity.SelectedItem + "','" + txtdistrict.Text + "','" + txtpincode.Text + "','" + txtfax.Text + "','" + txtophone.Text + "','" + txtrphone.Text + "','" + txtmobile.Text + "','" + txtemail.Text + "','" + txtwebsite.Text + "','" + ddlproducttype.Text + "','" + ddlproduct.Text + "','" + txtremarks.Text + "','" + txtdob.Text + "')";
cmd = new MySqlCommand(str, Classmysql.con);
tn = Classmysql.con.BeginTransaction(IsolationLevel.Serializable);
// tn = Classmysql.con.BeginTransaction();
cmd.Transaction = tn;
cmd.ExecuteNonQuery();
tn.Commit();
i had made change in commented tn .then this error comes.
Sandeep Mewara 16-Feb-13 2:59am    
I said "connection string". Please verify that. string that tells, where is the server and the datbase name in that server + any credentials to access it.
Member 8825505 16-Feb-13 3:09am    
this is my connection string
con.ConnectionString = @"server=localhost;User Id=root; pwd=root;Persist Security Info=True;database=pacecrm ";
that work well but when i change in Classmysql.con.BeginTransaction();
instead of tn = Classmysql.con.BeginTransaction(IsolationLevel.Serializable);
i gives error.

Naveen.Sanagasetti 16-Feb-13 3:20am    
Once please 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

1 solution

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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900