1. Connect to SQL2000 [sa Login]
String sqlconnection = @ "Server = (local); database = dB; user id = sa; Pwd = 123 ";
2. Connect to SQL2000 [Windows Default logon identity]
String sqlconnection = "Server = (local); initial catalog = dB; Integrated Security = true ";
3. Connect to sql2005 [sa Login]
String sqlconnection = "Data Source = (local); database = dB; user id = sa; Pwd = 123 ";
4. Connect to sql2005 [Windows Default identity logon]
String sqlconnection = "Data Source = (local); initial catalog = dB; Integrated Security = true ";
5. Connect to the Access Database
String sqlconnection = "provider = Microsoft. Jet. oledb.4.0; datasource = C: begaspnetnorthwind. mdb ";
Use direct path:
String sqlconnection = "provider = Microsoft. Jet. oledb.4.0; Data Source = | datadirectory | \ an_erp_t.mdb"
6. Connect to the Excel table
String sqlconnection = "provider = Microsoft. Jet. oledb.4.0; Data Source = D: \ book \ book1.xls; extended properties = Excel 8.0 ";
7. Connect to the Oracle database
String sqlconnection = "Data Source = dB; user = system; Password = manager ";