Database connection string-Sybase
ODBC DSN
// ODBC DSN Using system. Data. ODBC; Odbcconnection conn = new odbcconnection (); Conn. connectionstring = "DSN = dsnname;" + "Uid = username;" + "Pwd = secret ;"; Conn. open (); |
ODBC -- sybase system 12 (12.5) ODBC driver
// ODBC -- sybase system 12 (12.5) ODBC driver Using system. Data. ODBC; Odbcconnection conn = new odbcconnection (); Conn. connectionstring = "Driver = {Sybase ase odbc driver};" + "Srvr = servername;" + "Uid = username;" + "Pwd = secret ;"; Conn. open (); |
ODBC -- sybase system 11 ODBC driver
// ODBC -- sybase system 11 ODBC driver Using system. Data. ODBC; Odbcconnection conn = new odbcconnection (); Conn. connectionstring = "Driver = {sybase system 11};" + "Srvr = servername;" + "Uid = username;" + "Pwd = secret ;"; Conn. open (); |
ODBC -- intersolv 3.10 ODBC driver
// ODBC -- intersolv 3.10 ODBC driver Using system. Data. ODBC; Odbcconnection conn = new odbcconnection (); Conn. connectionstring = "Driver = {intersolv 3.10 32-bit Sybase};" + "Srvr = servername;" + "Uid = username;" + "Pwd = secret ;"; Conn. open (); |
ODBC -- SQL Anywhere
// ODBC -- SQL Anywhere Using system. Data. ODBC; Odbcconnection conn = new odbcconnection (); Conn. connectionstring = "ODBC;" + "Driver = {Sybase SQL Anywhere 5.0};" + "Defaultdir = C:/myfolder/;" + "DBF = C:/mypath/dbname. DB;" + "Uid = username;" + "Pwd = secret;" + "DSN ="; "; // must be encoded! Conn. open (); |
Oledb -- Sybase Adaptive Server Enterprise (ASE)
// Oledb -- Sybase Adaptive Server Enterprise (ASE) Using system. Data. oledb; Oledbconnection conn = new oledbconnection (); Conn. connectionstring = "Driver = Sybase. aseoledbprovider;" + "Server name = servername, 5000;" + "Initial catalog = databasename;" + "User ID = username;" + "Password = secret ;"; Conn. open (); // Optionally, replace // 'Server name' with 'srvr ', and // 'Initial catalog 'with 'catalog' |
. Net dataprovider from Sybase
//. Net dataprovider from Sybase Using Sybase. Data. aseclient; Aseconnection conn = new aseconnection (); Conn. connectionstring = "Data Source = servername;" + "Initial catalog = databasename;" + "User ID = username;" + "Password = secret ;"; Conn. open (); |