Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Problem with MySQL connection

Problem with MySQL connection

Scheduled Pinned Locked Moved C#
helpcsharpasp-netdatabasemysql
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tantiboh
    wrote on last edited by
    #1

    I'm attempting to connect to a MySQL database from my ASP.NET application (c#). Here's my code: string connString = "Database=games;Data Source=http://[my server's IP]/mysql;User ID=group; Password=" + strSystemPasswords[3]; conn = new MySqlConnection(connString); conn.Open(); The database is contained in the mysql directory under the web server's root. (I added a space between group; and Password to prevent a smiley.) When I run the code, I get the following error for conn.Open(): "The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for " I've researched the problem and have found the standard answer is that the address can't be resolved. However, I am assuming that this is not the problem in my case, as I can navigate to that exact address with my web browser. But I haven't found any alternate causes for this error. Any suggestions? Thanks for your help!

    D 1 Reply Last reply
    0
    • T tantiboh

      I'm attempting to connect to a MySQL database from my ASP.NET application (c#). Here's my code: string connString = "Database=games;Data Source=http://[my server's IP]/mysql;User ID=group; Password=" + strSystemPasswords[3]; conn = new MySqlConnection(connString); conn.Open(); The database is contained in the mysql directory under the web server's root. (I added a space between group; and Password to prevent a smiley.) When I run the code, I get the following error for conn.Open(): "The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for " I've researched the problem and have found the standard answer is that the address can't be resolved. However, I am assuming that this is not the problem in my case, as I can navigate to that exact address with my web browser. But I haven't found any alternate causes for this error. Any suggestions? Thanks for your help!

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Your datasource is local to the server. ASP.NET is a server-side only technology that generates HTML for a client. Change your "Data Source" so your code is looking for it local to the server filesystem, not over an http connection. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups