Search code examples
connection-stringsybasesqlanywhere

How to connect remotely with Sybase SQLAnywhere.SAConnection?


I'm trying to connect with .net to a remote sybase sql anywhere database.

I don't see much info online how to connect, mostly ODBC or DSN files.

I tried this connection string:

Data Source=myserver.com;Port=2638;Uid=myuser;Pwd=mypass

Which gives the following error

Invalid connection string. Invalid or missing keyword near 'Port' Parameter name: connectionString

So I tried to include the port with the server, like this:

Data Source=myserver.com:2638;Uid=myuser;Pwd=mypass

Which gives a new error:

DSN 'myserver:2638' does not exist

So, what is the correct connection string?

PS. Using sybase central, I was able to connect to the database, so it's not a network / firewall / port issue.

Thanks!


Solution

  • You want to use HOST=myserver.com:2638;uid=myuser;pwd=mypass. The list of valid connection parameters is documented here.