using System.Data.SqlClient; var connectionString = "data source=MySqlServer; initial catalog=MyDatabase; user id=MyUsername; password=MyPassword"; var connection = new SqlConnection(connectionString); connection.Open();
using System.Data.OracleClient; var connectionString = "Data Source=MyOracleServer; User ID=MyUsername; Password=MyPassword;"; var connection = new OracleConnection(connectionString); connection.Open();Both examples use different database-specific connection classes that inherit from `DbConnection`. The `Open()` method is used to open a connection to the specified database using the provided connection string. The package library that contains `System.Data.Common` is `System.Data.Common.dll`, which is part of the .NET Framework and can be found in the GAC (Global Assembly Cache).