Click here to Skip to main content
14,386,783 members
Rate this:
Please Sign up or sign in to vote.
The timeout period elapsed prior to completion of the operation or the server is not responding.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: MySql.Data.MySqlClient.MySqlException: Timeout expired. The
Description: getting an error on con.open();

Error: timeout period elapsed prior to completion of the operation or the server is not responding.

Source Error:



Line 35:                     {
Line 36:                       
Line 37:                         con.Open();
Line 38:


What I have tried:

using (MySqlConnection con = new MySqlConnection("Data Source = 92.80.422.422;User ID = mide; Password = Mfggggh0; database = tt"))
            {
con.open();
                //Open the connection
                if (TextBox1.Text == "Mi" & TextBox2.Text == "ukm")
                {
                    
                    Response.Redirect("Pd.aspx");

                }
Posted
Updated 5-Nov-19 22:39pm
v3

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Read the error message:
timeout period elapsed prior to completion of the operation or the server is not responding.

At a guess, the server is not responding.
Check your connection string, make sure that it works - the chances are that the IP address you are using is not available from that location.

And two things:
1) Change your id / password setup: you just told 14,000,000 people how to log in to your DB and do what they want...
2) Don't hardcode connection strings: they need to be in a configuration file. If for no other reasons that you very definitely should not be testing code against a production DB, and shouldn't release untested code ...
   
Comments
Member 14192879 6-Nov-19 6:16am
   
my IP address is correct but the IP address i gave in an example is demo IP. Is there any other way to check that connection is working or not?
OriginalGriff 6-Nov-19 6:35am
   
You could try this:

https://www.codeproject.com/Tips/1198443/Simple-SQL-Connection-String-Creation

I don't know if it works with MySql DB's though - if the engine is installed it probably should.
Member 14192879 6-Nov-19 23:09pm
   
I am using MySQL. I want to connect GoDaddy Plesk mysql with a visual studio. I checked IP address even I downloaded MySQL and visual studio again but still, I am facing same problem

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100