C#怎么链接数据库?这几个有什么不同?
1.<appSettings><addkey="DBConnectionString"value="server=服务器;database=数据库;UserId=sa;p...
1.
<appSettings>
<add key="DBConnectionString" value="server=服务器;database=数据库;User Id=sa;pwd=123456789"/>
</appSettings>
2.
<connectionStrings>
<add name="ConnectionStringName" connectionString="Data Source=服务器;Initial Catalog=数据库;User ID=sa;Password=123456789"
providerName="System.Data.SqlClient" />
</connectionStrings>
3.
<connectionStrings>
<add name="ConnectionStringName" connectionString="sever=服务器;database=数据库;User ID=sa;Password=123456789"
providerName="System.Data.SqlClient" />
</connectionStrings> 展开
<appSettings>
<add key="DBConnectionString" value="server=服务器;database=数据库;User Id=sa;pwd=123456789"/>
</appSettings>
2.
<connectionStrings>
<add name="ConnectionStringName" connectionString="Data Source=服务器;Initial Catalog=数据库;User ID=sa;Password=123456789"
providerName="System.Data.SqlClient" />
</connectionStrings>
3.
<connectionStrings>
<add name="ConnectionStringName" connectionString="sever=服务器;database=数据库;User ID=sa;Password=123456789"
providerName="System.Data.SqlClient" />
</connectionStrings> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询