SQL數據庫的連接
return new SqlConnection("server=127.0.0.1;database=part;uid=sa;pwd=;");
Oracle連接字符串
OracleConnection oCnn = new OracleConnection("Data Source=ORCL_SERVER;USER=M70;PASSWord=mmm;");
oledb連接數據庫
return new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Jet OLEDB:Database PassWord=密碼;Data Source=" + HttpContext.Current.Server.MapPath("數據庫名稱"));
或
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Jet OLEDB:Database PassWord=;Data Source=" +AppDomain.CurrentDomain.BaseDirectory + "area.mdb");
SQLCE
new SqlCeConnection("Data Source =Storage Card/CG.sdf ");