70-516 · Question #140
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Microsoft ASP.NET application. You want to connect the application to a Microsoft SQL Server Express 2008 database…
The correct answer is C. Data Source=.\SQLEXPRESS; AttachDbFilename=|DataDirectory|\MyDatabase.mdf. CHAPTER 2 ADO.NET Connected Classes Lesson 1: Connecting to the Data Store Attaching to a Local SQL Database File with SQL Express (page 73)
Question
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Microsoft ASP.NET application. You want to connect the application to a Microsoft SQL Server Express 2008 database named MyDatabase. The primary database file is named MyDatabase.mdf and it is stored in the App_Data folder. You need to define the connection string. Which connection string should you add to the Web.config file?
Options
- AData Source=localhost; Initial Catalog=MyDataBase; Integrated Security=SSPI;
- BData Source=.\SQLEXPRESS; Initial Catalog=MyDataBase; Integrated Security=True;
- CData Source=.\SQLEXPRESS; AttachDbFilename=|DataDirectory|\MyDatabase.mdf;
- DData Source=.\SQLEXPRESS;
How the community answered
(22 responses)- A5% (1)
- B14% (3)
- C77% (17)
- D5% (1)
Explanation
CHAPTER 2 ADO.NET Connected Classes Lesson 1: Connecting to the Data Store Attaching to a Local SQL Database File with SQL Express (page 73)
Topics
Community Discussion
No community discussion yet for this question.