SQL Server数据库 SqlConnection
SqlConnection thisConnection = new SqlConnection(@"Server = (local);" + "User ID = sa;" + "Password = ;" + "Connection Timeout = 5;");
或者
SqlConnection thisConnection = new SqlConnection(@"Server = (local);" + "Integrated Security = true;" + "Connection Timeout = 5;");
Access数据库 OledbConnection
OleDbConnection thisConnection = new OleDbConnection(@"Provider = Microsoft.Jet.OLEDB.4.0;" + @"Data Source = c:\acces.mdb;" + "Connection Timeout = 5");
Oracle数据库 OleDbConnection OracleConnection
OleDbConnection thisConnection = new OleDbConnection(@"Provider = MSDAORA;" + @"Data Source = testdb; User ID = scott;Password = tiger");
OracleConnection thisConnection = new OracleConnection(@"SERVER = testdb;" + "UID = scott;" + "PASSWORD = tiger;");
MySQL数据库 OdbcConnection
OdbcConnection thisConnection = new OdbcConnection("DRIVER = {MySQL ODBC 3.51 Driver};" + "SERVER = localhost;" + "DATABASE = test;" + "UID = root;" + "PASSWORD = ;");
如有不到之处请给于指正 谢谢