PrepAway - Latest Free Exam Questions & Answers

Which connection string should you add to the app.config file?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. You
use the ADO.NET Entity Framework to model your entities. The application connects to a Microsoft
SQL Server 2008 database named Adventure Works by using Windows Authentication. Information
about the required Entity Data Model (EDM) is stored in the following files:
• model.csdl
• model.ssdl
• model.msi
These files are embedded as resources in the MyCompanyData.dll file. You need to define the
connection string that is used by the application. Which connection string should you add to the
app.config file?

PrepAway - Latest Free Exam Questions & Answers

A.
<add name=”AdventureWorksEntities”
connectionString=”metadata=res://MyComparny.Data,
Culture=neutral,PublicKeyToken=null/model.csdIl
res://MyCompany.Data,Culture=neutral, Public KeyToken=null/model.ssdll res:
//MyCompany.Data,Culture=neutral, PublicKeyToken
=null/model.msl;provider=System.Data EntityClient.provider connection
string=’DataSource=localhost;
Initial Catalog=AdventureWorks;lntegrated Security=True;multipleactivesuitsets=true”
providerName=”System.Data.SqlClient”/>

B.
<add name=”AdventureWorksEntities”

connectionString=”metadata=res://MyComparny.Data,Culture=neutral,PublicKeyToken=null/model.
csdIl
res://MyCompany.Data,Culture=neutral, Public KeyToken=null/model.ssdll
res: //MyCompany.Data,Culture=neutral, PublicKeyToken =null/model.msl;
provider=System.Data EntityClient.provider connection string=’DataSource=localhost;
Initial Catalog=AdventureWorks;lntegrated Security=True;multipleactivesuitsets=true”
providerName=”System.Data.EntityClient”/>

C.
<add name=”AdventureWorksEntities”
connectionString=”metadata=res://MyComparny.Datamodel.csdl|
res://MyCompany.Data.model.ssdl|
res://MyComparny.Datamodel.msi;
provider=System.Data.SqlClient.provider connection string=’DataSource=localhost;
Initial Catalog=AdventureWorks;lntegrated Security=SSPI;multipleactivesuitsets=true”
providerName=”System.Data.EntityClient”/>

D.
<add name=”AdventureWorksEntities”
connectionString=”metadata=res://MyComparny.Data,Culture=neutral,PublicKeyToken=
null/model.csdIl
res://MyComparny.Data,Culture=neutral,PublicKeyToken=null/model.ssdIl
res://MyComparny.Data,Culture=neutral,PublicKeyToken=null/model.msi;
provider=System.Data.OleDBClient.provider connection
string=’Provider=sqloledb;DataSource=localhost;
Initial Catalog=AdventureWorks;lntegrated Security=SSPI;multipleactivesuitsets=true”
providerName=”System.Data.EntityClient”/>

Explanation:
Answering this question pay attention to fact that Entity Framework is used, so settings
provider=”System.Data.SqlClient” and providerName=”System.Data.EntityClient” shold be set.
Connection Strings
(http://msdn.microsoft.com/en-us/library/cc716756.aspx)


Leave a Reply