Dear Group,

I have a C# client connecting to a remote mySql database and I'm
getting the following exception:

Unhandled Exception: System.Data.SqlClient.SqlException: SQL Server
does not exi
st or access denied.
at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransactio
n)
at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConn
ectionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at MainClass.Connect() in e:\NET\db\dbaccess\Main.cs:line 35
at MainClass.Main(String[] args) in e:\NET\db\dbaccess\Main.cs:line
65

This is what my my connect method looks like:

SqlConnection sqlCon = null;
string conStr1 = "Data Source=" + ipAddress +
" ; Database=hightechzen" +
" ; User ID=userid" +
" ; Password=password";
sqlCon = new SqlConnection(conStr1);
sqlCon.Open();

This is my namespace definition:

using System.Data;
using System.Data.SqlClient;

Using a mySql client UI (navicat), I can connect to mySql. So my
machine is setup for access. What do I need to do in my c# client to
connect.

Thanks in advance,

Cindy

Re: SqlException while Connecting to mySQL by Miha

Miha
Fri Dec 19 11:22:56 CST 2003

Hi Cindy,

Try with this connection string:
workstation id=***;packet size=4096;user id=***;data
source=YourDataSource;initial catalog=Northwind;persist security
info=True;password=***

If you pass an IP address as datasource, make sure it is within parenthesis:
data source="10.0.0.1";
--
Miha Markic - RightHand .NET consulting & development
miha at rthand com

"Cindy" <djcee@cox.net> wrote in message
news:9736f8.0312190749.d6c0565@posting.google.com...
> Dear Group,
>
> I have a C# client connecting to a remote mySql database and I'm
> getting the following exception:
>
> Unhandled Exception: System.Data.SqlClient.SqlException: SQL Server
> does not exi
> st or access denied.
> at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
> isInTransactio
> n)
> at
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConn
> ectionString options, Boolean& isInTransaction)
> at System.Data.SqlClient.SqlConnection.Open()
> at MainClass.Connect() in e:\NET\db\dbaccess\Main.cs:line 35
> at MainClass.Main(String[] args) in e:\NET\db\dbaccess\Main.cs:line
> 65
>
> This is what my my connect method looks like:
>
> SqlConnection sqlCon = null;
> string conStr1 = "Data Source=" + ipAddress +
> " ; Database=hightechzen" +
> " ; User ID=userid" +
> " ; Password=password";
> sqlCon = new SqlConnection(conStr1);
> sqlCon.Open();
>
> This is my namespace definition:
>
> using System.Data;
> using System.Data.SqlClient;
>
> Using a mySql client UI (navicat), I can connect to mySql. So my
> machine is setup for access. What do I need to do in my c# client to
> connect.
>
> Thanks in advance,
>
> Cindy



Re: SqlException while Connecting to mySQL by Morgan

Morgan
Fri Dec 19 13:41:12 CST 2003

You can also find info at www.connectionstrings.com

"Cindy" <djcee@cox.net> wrote in message
news:9736f8.0312190749.d6c0565@posting.google.com...
> Dear Group,
>
> I have a C# client connecting to a remote mySql database and I'm
> getting the following exception:
>
> Unhandled Exception: System.Data.SqlClient.SqlException: SQL Server
> does not exi
> st or access denied.
> at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
> isInTransactio
> n)
> at
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConn
> ectionString options, Boolean& isInTransaction)
> at System.Data.SqlClient.SqlConnection.Open()
> at MainClass.Connect() in e:\NET\db\dbaccess\Main.cs:line 35
> at MainClass.Main(String[] args) in e:\NET\db\dbaccess\Main.cs:line
> 65
>
> This is what my my connect method looks like:
>
> SqlConnection sqlCon = null;
> string conStr1 = "Data Source=" + ipAddress +
> " ; Database=hightechzen" +
> " ; User ID=userid" +
> " ; Password=password";
> sqlCon = new SqlConnection(conStr1);
> sqlCon.Open();
>
> This is my namespace definition:
>
> using System.Data;
> using System.Data.SqlClient;
>
> Using a mySql client UI (navicat), I can connect to mySql. So my
> machine is setup for access. What do I need to do in my c# client to
> connect.
>
> Thanks in advance,
>
> Cindy



Re: SqlException while Connecting to mySQL by GS

GS
Fri Dec 19 14:11:34 CST 2003

You can't connect to a "mySQL" database using the SqlClient which uses the
native provider for SQL Server.
You have to use the classes in whichever ADD-ON you choose that exposes a
provider for MySQL.
One of such addons is for example MySQLDirect.NET available at
http://crlab.com/mysqlnet/

Remember Classes in the System.Data.SqlClient are only good to access data
in a Microsoft SQL Server instance (7 & Above).

Hope this helps,


Guillermo Salas
Milwaukee, WI


"Cindy" <djcee@cox.net> wrote in message
news:9736f8.0312190749.d6c0565@posting.google.com...
Dear Group,

I have a C# client connecting to a remote mySql database and I'm
getting the following exception:

Unhandled Exception: System.Data.SqlClient.SqlException: SQL Server
does not exi
st or access denied.
at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransactio
n)
at
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConn
ectionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at MainClass.Connect() in e:\NET\db\dbaccess\Main.cs:line 35
at MainClass.Main(String[] args) in e:\NET\db\dbaccess\Main.cs:line
65

This is what my my connect method looks like:

SqlConnection sqlCon = null;
string conStr1 = "Data Source=" + ipAddress +
" ; Database=hightechzen" +
" ; User ID=userid" +
" ; Password=password";
sqlCon = new SqlConnection(conStr1);
sqlCon.Open();

This is my namespace definition:

using System.Data;
using System.Data.SqlClient;

Using a mySql client UI (navicat), I can connect to mySql. So my
machine is setup for access. What do I need to do in my c# client to
connect.

Thanks in advance,

Cindy



Re: SqlException while Connecting to mySQL by Miha

Miha
Fri Dec 19 14:42:29 CST 2003

Hehehe, at least one reads the question :)

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rhand.com

"GS" <gsalas@ihsiq.com> wrote in message
news:e2MdTxmxDHA.2084@TK2MSFTNGP09.phx.gbl...
> You can't connect to a "mySQL" database using the SqlClient which uses the
> native provider for SQL Server.