Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2006
    Posts
    6

    Unanswered: MySQL Connection String

    Hey,

    I know this should be simple but for the life of me I cannot connect to my mysql db.

    I am using asp.net with c# code, I have tried the following strings, and they compile fine but when executing the page i get a

    "System.Data.SqlClient.SqlException: SQL Server does not exist or access denied."

    It points to the line "myConnection.Open();"

    The connection strings i supplied are:

    SqlConnection myConnection = new SqlConnection("Data Source=(202.174.100.40);Initial Catalog=testdb;User ID=test;Password=testpass");

    SqlConnection myConnection = new SqlConnection("Data Source=(202.174.100.40);Database=testdb;User ID=test;Password=testpass;Trusted_Connection=yes") ;

    SqlConnection myConnection = new SqlConnection("server=(202.174.100.40)\\NetSDK;dat abase=testdb;Trusted_Connection=yes");


    Does anyone know what I am doing wrong? I was given the IP address by my ISP, they have assured me its correct.

    Thanks for your time in reading this,

  2. #2
    Join Date
    Jul 2004
    Location
    Dundee, Scotland
    Posts
    107
    we normally install mysql on our computer using "localhost" (127.0.0.1). Is this not the case with your installation?

    you're ISP might well have given you a static IP address as opposed to a dynamically allocate one. if using Windows you can check your IP address in a DOS window by typing "ipconfig".

    I use php with mysql. sorry I can't be of more help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •