In MSDN, the .NET's database connection string has a detailed description, I have some ways of code examples, and the meaning of each representative can be found in the MSDN. ADO.NET Database connection method (Microsoft is provided) Microsoft provides the following four database connection: System.Data.OleDb.OleDbConnectionSystem.Data.SqlClient.SqlConnectionSystem.Data.Odbc.OdbcConnectionSystem.Data.OracleClient.OracleConnection Here we have an example of the way in order to explain: System.Data. SqlClient.SqlConnection some common connection string (C # Code): SqlConnection conn = new SqlConnection ( "Server = (local); Integrated Security = SSPI; database = Pubs"); SqlConnection conn = new SqlConnection ( "server = (local) // NetSDK; database = pubs; Integrated Security = SSPI "); SqlConnection conn = new (SqlConnection" Data Source = localhost; Integrated Security = SSPI; Initial Catalog = Northwind; "); SqlConnection conn = new SqlConnection (" data source = (local); initial catalog = xr; integrated security = SSPI; persist security info = False; workstation id = XURUI; packet size = 4096; "); SqlConnection myConn = new System.Data.SqlClient.SqlConnection (" Persist Security info = False; integrated security = sspi; database = northwind; server = mysqlserver "); sqlConnection conn = new SQLC Onnection ("UID = SA; PWD = Passwords; Initial Catalog = Pubs; Data Source = 127.0.0.1; connection timeout = 900"); More String Connections Please see MSDN: http://msdn.microsoft.com/ library / default.asp url = / library / en-us / cpref / html / frlrfSystemDataSqlClientSqlConnectionClassConnectionStringTopic.asp System.Data.OleDb.OleDbConnection some common connection string (C # Code):? OleDbConnection conn = new OleDbConnection (@ "Provider = Microsoft.jet.Oledb.4.0; data source = d: /myweb/81/05/grocertogo.mdb "); OLEDBCONNECTION CONN = New OLEDBCONNECTION (@"
Provider = Microsoft.Jet.OLEDB.4.0; Password =; User ID = Admin; Data Source = grocertogo.mdb; "); OleDbConnection conn = new OleDbConnection (" Provider = MSDAORA; Data Source = ORACLE8i7; Persist Security Info = False; Integrated Security = yes "); OleDbConnection conn = new OleDbConnection (" Provider = Microsoft.Jet.OLEDB.4.0; Data Source = c: /bin/LocalAccess40.mdb "); OleDbConnection conn = new OleDbConnection (" Provider = SQLOLEDB; Data Source = mysqlserver; integrated security = sspi "); More string connection notes See msdn: http://msdn.microsoft.com/library/default.asp? URL = / library / en-us / cpref / html / ? frlrfSystemDataOleDbOleDbConnectionClassConnectionStringTopic.asp frame = true System.Data.OracleClient.OracleConnection some common connection string (C # Code): OracleConnection myConn = new System.Data.OracleClient.OracleConnection ( "Data Source = Oracle8i; Integrated Security = yes"); more string concatenation Description see MSDN: http: //msdn.microsoft.com/library/default.asp url = / library / en-us / cpref / html / frlrfSystemDataOracleClientOracleConnectionClassConnectionStringTopic.asp frame = true System.Data??. O dbc.OdbcConnection some common connection string (C # Code): OdbcConnection conn = new OdbcConnection ( "Driver = {SQL Server}; Server = MyServer; Trusted_Connection = yes; Database = Northwind;"); OdbcConnection conn = new OdbcConnection ( " Driver = {Microsoft ODBC for Oracle}; Server = ORACLE8i7; Persist Security Info = False; Trusted_Connection = yes "); OdbcConnection conn = new OdbcConnection (" Driver = {Microsoft Access Driver (* .mdb)}; DBQ = c: / BIN / NWIND.MDB "); odbcconnection conn = new odbcconnection (" driver = {microsoft excel driver (* .xls)}; dbq =
C: /bin/book1.xls "); odbcconnection conn = new odbcconnection (" driver = {microsoft text driver (* .txt; * .csv)}; dbq = c: / bin "); odbcconnection conn = new ODBCCONNECTION "DSN = dsnname"); more string concatenation Description see MSDN: http: //msdn.microsoft.com/library/default.asp url = / library / en-us / cpref / html / frlrfSystemDataOdbcOdbcConnectionClassConnectionStringTopic.asp?? Frame = TRUE Database connection provided by other vendors: db2connection myconn = new ibm.data.db2.db2connection ("Database = Sample; UID =