setting a connection with database?

Posted on 2003-03-14
Medium Priority
Last Modified: 2010-04-15
string myConnectString = "Server=localhost;Database=test;Uid=john;Pwd=pass";
SqlConnection MyConn = new SqlConnection(myConnectString);

when i run the code, it says access denied or server doesnt exist. but i set up the database using MySql. advice? tnx
Question by:amgln
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
LVL 22

Accepted Solution

Mohammed Nasman earned 150 total points
ID: 8138200

  You are using the SqlConnection to connect to MySql, Sqlconnection designed for MS Sql Server 7/2000 only and will not work with other DB, try to use OleDBConnection if you have OleDB driver for MySql, or Install ODBC.Net to access MySql using the ODBC

Best regards
Mohammed Nasman

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question