المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Sybase connection error...



C# Programming
06-03-2009, 03:00 PM
I'm trying to connect to Sybase Server (Adaptive Server Anywhere 6.0) from my C# application but failed to establish a connection.... it seems the C# use a default MSSQL driver. Below is the error:

"An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"

below is the code:

//string bartsConnect = "Driver={Adaptive Server Anywhere 6.0};SRVR=MyServer;DB=MyDatabase;UID=myUserId;PWD=myPassword";

string myConnection = "server=ServerName;Database=myDatabase;uid=myUserId;pwd=myPassword";
SqlConnection myConnection = new SqlConnection(myConnection);
myConnection.Open();

hope to hear some answers soon,,,, thank you.

xxx