Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 07-03-2009
Member
 
Join Date: Jan 2009
Posts: 61
Connection Unexpectedly Terminated!

I am having a strange problem with the MySQL Connector .NET 1.0.6. I am trying to develop a .NET (Version 1.1 SP1) application on a Windows 2000
Professional machine with MySQL Server 4.1.14 version.

A huge amount of SQL query does execute for about 40 minutes but then cancels with the exception "Connection unexpectedly terminated".

I don't know waht is wrong in this

Please provide some views regarding this
Reply With Quote
  #2  
Old 07-03-2009
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: Connection Unexpectedly Terminated!

try
{
// Edit connection settings here!
MySqlConnection conn = new MySqlConnection( "server=localhost;user
id=xxx;password=yyy;database=zzz;port=3306" );
conn.Open();

// Do a SELECT on a table with many rows here!
MySqlCommand cmd = new MySqlCommand( "SELECT * FROM xyz LIMIT 1000", conn
);
MySqlDataReader reader = cmd.ExecuteReader();

while ( reader.Read() )
{
// Let's sleep for a moment. Important for reproducing the bug!
Thread.Sleep( 2400 );
}

MessageBox.Show( this, "Done" );
}
catch( Exception ex )
{
MessageBox.Show( this, ex.Message, "Exception!", MessageBoxButtons.OK,
MessageBoxIcon.Error );
}

Since the bug seems to be strongly connected to some timeout, I've tried to
manipulate several server variables which are related to timeout settings.
Reply With Quote
  #3  
Old 07-03-2009
Member
 
Join Date: May 2008
Posts: 2,008
Re: Connection Unexpectedly Terminated!

Could you post your connectionstring?

Wich version of the Mysql .Net connector are you using?

Do you get this error always? Can you make an connection by using server explorer and create a new dataconnection?
Reply With Quote
  #4  
Old 07-03-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: Connection Unexpectedly Terminated!

Stack Trace:
[HttpException (0x80004005): Request timed out.]

i have set the connection string with connect timeout 3000.

surely it shold not take that long
Reply With Quote
  #5  
Old 07-03-2009
Member
 
Join Date: May 2008
Posts: 2,293
Re: Connection Unexpectedly Terminated!

Are you sure you can access that database? Can you access it by some other tool?

Have you checked that your connecting at the right port? Is there a firewall between?

I have installed one of the 5.x.x mysql connectors for .Net and i can make a connection from Server Control

(New connection, and then change type to mysql)

Have you tried installing a new version of mysql connector?
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Connection Unexpectedly Terminated!"
Thread Thread Starter Forum Replies Last Post
Getting error message "The TCP/IP connection was unexpectedly terminated by the server (NNTP)" Nearer Networking & Security 7 29-01-2012 11:11 AM
error ?Malwarebyte service terminated unexpectedly? Kaalia Networking & Security 6 22-12-2011 07:34 PM
The Print Spooler service terminated unexpectedly. Drewski Windows XP Support 6 08-08-2011 05:09 AM
Intellisync - The operation Terminated unexpectedly Agaev Portable Devices 5 24-07-2010 06:13 AM
System shutdown due to RPC terminated unexpectedly Hardik Windows XP Support 6 07-08-2009 05:12 PM


All times are GMT +5.5. The time now is 05:35 AM.