• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
wjshan0808

Learn from yesterday, Live for today, For a better tomorrow.
 ————wjshan0808

博客园    首页    新随笔    联系   管理    订阅  订阅

数据库连接字符串

<add key="ConnectionStrings" value="data source =(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =localhost)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl))); user=SYSTEM; password=123;" />
 <add name="ApplicationServices"
         connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
         providerName="System.Data.SqlClient" />
 new SqlConnection("server=LJM\\MSSQL2005;database=MySchool;uid=sa;pwd=123456")

//连接Access数据库

new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;data source=student.mdb;persist security info=false")

new MySqlConnection("server=LJM\\MSSQL2005;database=MySchool;uid=sa;pwd=123456")
 new OracleConnection("Data Source=Oracle8i;Integrated Security=yes")
new SqlConnection("server=(local)\\sqlexpress;database=Mybookshop;uid=sa;pwd=1234")
 new OleDbConnection(@"Provider=Microsoft.Jet.OleDb.4.0;Data Source=books.mdb")
<add name="sql" connectionString="Data Source=.;Initial CataLog=DBLQBZ;Integrated Security=true;"/>
<add name="sql" connectionString="Data Source=127.0.0.1;Initial Catalog=test;User Id=sa;Password=123;"/>
 new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\DB\MySchool.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True")

 

//定义连接加密ACCESS数据库的字符串
            string strFilePath = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" + Path + "\\DB_Test.mdb;Jet OLEDB:Database Password=123456";
            

 


posted @ 2015-01-14 09:13  wjshan0808  阅读(239)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3