SQL数据库的连接
return new SqlConnection("server=127.0.0.1;database=part;uid=sa;pwd=;");
oracle连接字符串
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");
或
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 ");
new SqlCeConnection("Data Source =Storage Card/CG.sdf ");