The following are example connection strings for connecting to different types of SQL database when using
.NET:
- IBM DB2
- Database=SAMPLE;User ID=<username>;Password=<password>;Server=localhost;Factory=IBM.Data.DB2.Core;
- MySQL
- Server=localhost;Uid=<username>;Pwd=<password>;Database=<databasename>;Factory=MySql.Data;
- Oracle
- DATA SOURCE=ORCL;USER ID=<username>;PASSWORD=<password>;Factory=Oracle.ManagedDataAccess;
- PostgreSQL
- Host=localhost;Database=<databasename>;Username=<username>;Password=<password>;Factory=Npgsql;
- SQL Server
- Data Source=(local);Initial Catalog=<databasename>;Integrated Security=True;MultipleActiveResultSets=True; Factory=System.Data.SqlClient;