问题描述
我是新来ASP.NET维尔,要温柔。
I'm new to ASP.NET-ville, be gentle.
我已经故障排除ASP.NET设置,其中服务器/数据库值都在变化,因此web.config中需要更新。
I have been troubleshooting a ASP.NET setup, where the server/database values are changing, therefore web.config needs to be updated.
有多个<添加名称=NameXYZ的connectionString =嗒嗒/>
实例(多个ASP.NET组件),但其中的一些被标记达不同的他人。
There are multiple <add name="NameXYZ" connectionString="blah" />
instances (multiple ASP.NET components), but some of these are marked up differently to others.
我已经得到了以下规定:
I've got the following provided:
<add name="CONNECTION-B" connectionString="metadata=res://*/ZZZZ.ssdl;provider=System.Data.SqlClient;provider connection string="Data Source=XXX;Initial Catalog=YYY;Persist Security Info=True;User ID=AAA;Password=BBBB;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
<add name="CONNECTION-A" connectionString="server=XXX;database=YYY;user id=XXX;password=BBB" />
我用取代值在上面,使得假设两种格式类型:
I've used substituted values in the above, making the assumption that for both format types:
- XXX是服务器(MSSQL主机)
- YYY是数据库名称
- AAA是数据库用户,
- BBB是用户密码。
(ZZZZ是什么管道分隔列表)
(ZZZZ is a pipe-delimited list of something)
问题如下:
A)是我的代名词连接字符串方面的假设是否准确? (数据源&LT; =>服务器,数据库和LT =>初始目录)
A) Is my assumption of synonymous connection string terms accurate? (Data Source <=> server, database <=> initial catalog)
B)是否有标记任何语法错误?一些MSDN文档,我抬起头采用双,单,和&放大器; QUOT;
交替标志着
B) Are there any syntax errors in the markup? Some MSDN documents I've looked up use double, single, and "
marks interchangeably.
推荐答案
有两种不同类型的这里连接字符串。最好的办法(IMO)是有在文档读了 -
There are two different types of connection strings here. The best bet (IMO) is to have a read up in the docs -
首先是ADO.Net连接字符串:http://msdn.microsoft.com/en-us/library/ms254500.aspx
The first is an ADO.Net connection string: http://msdn.microsoft.com/en-us/library/ms254500.aspx
二是实体框架的连接字符串:http://msdn.microsoft.com/en-us/library/cc716756.aspx
The second is an Entity Framework connection string: http://msdn.microsoft.com/en-us/library/cc716756.aspx
这一切都在这两个环节,肯定更清晰的解释比我能解释一下!
It's all explained in those two links, certainly clearer than I can explain it!
这篇关于ASP.NET连接字符串的元数据的语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!