1
Answer

Sybase and .Net Connectivity using Sql Anywhere

Hi,
 
I am struggling with connecting the .Net application with the Sybase. Below is my code.
I am using the iAnywhere.Data.AsaClient.dll to connect with. It is 9.0 version. It is showing the error message [No database file specified]. 
 
Please help. 
 
private static iAnywhere.Data.AsaClient.AsaConnection SQLAnyWhereConnect(out String strErrorMsg)
{
strErrorMsg = string.Empty;
iAnywhere.Data.AsaClient.AsaConnection objConnection = null;
try
{
objConnection = new iAnywhere.Data.AsaClient.AsaConnection();
objConnection.ConnectionString = "DatabaseName = DatabaseName, UserID = dba, Password = dba, ServerName = DatabaseServerName, Host = xxx.xxx.xxx.xxx:xxx";
objConnection.Open();
}
catch (Exception exp)
{
Console.ReadLine();
strErrorMsg = exp.ToString();
Console.WriteLine(exp);
Console.ReadLine();
}
return objConnection;
}
 
 
 
Answers (1)