ConnectionString

出自 ProgWiki
前往: 導覽搜尋

ConnectionString,參照:『維基百科~Connection_string

應用

  • 以下以ASP.NET於Web.config裡的使用方式記載,其他的格式請參照[1]

MS-SQL Server

<connectionStrings>
<add name="myConnectionString"
 connectionString="Data Source=localhost;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;"
 providerName="System.Data.SqlClient"/>
</connectionStrings>

MS-SQL Server Express

<connectionStrings>
<add name="myConnectionString"
 connectionString="Data Source=localhost\SQLExpress;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;"
 providerName="System.Data.SqlClient"/>
</connectionStrings>

Oracle

<connectionStrings>
<add name="myConnectionString"
 connectionString="Data Source=MyOracleDB;Persist Security Info=True;User ID=myUsername;Password=myPassword;Unicode=True"
 providerName="System.Data.OracleClient"/>
</connectionStrings>

相關

自組ConnectionString