Course Hero Logo

70-516CSHARP Update Test Practice Questions -...

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 - 4 out of 16 pages.

Certification Preparation MaterialPage | 1Microsoft70-516CSHARPAccessing Data with Microsoft .NET FrameworkDemo Product - For More Information - Visit:Edition = DEMOProductFull Version Features:90 Days Free Updates30 Days Money Back GuaranteeInstant Download Once Purchased24/7 Online Chat Support
Certification Preparation MaterialQuestion: 1You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The applicationcontains the following code segment. (Line numbers are included for reference only.)01class DataAccessLayer0203private static string connString;0405...06public static DataTable GetDataTable(string command){0708...0910You need to define the connection life cycle of the DataAccessLayer class. You also need to ensure that theapplication uses the minimum number of connections to the database. What should you do?Insert the following code segment at line 04.private static SqlConnection conn = new SqlConnection(connString);public static void Open(){conn.Open();}public static void Close(){conn.Close();}B.Insert the following code segment at line 04.private SqlConnection conn = new SqlConnection(connString);public void Open(){conn.Open(); }public void Close(){conn.Close();}C.Replace line 01 with the following code segment.class DataAccessLayer : IDisposableInsert the following code segment to line 04.private SqlConnection conn = new SqlConnection(connString);public void Open(){conn.Open();}public void Dispose(){conn.Close();}D.Insert the following code segment at line 07.using (SqlConnection conn = new SqlConnection(connString)){conn.Open();}{}}
Page | 2Explanation:One thing you should always do is to make sure your connections are always opened within a using statement.Using statements will ensure that even if your application raises an exception while the connection is open, it willalways be closed(returned to the pool) before your request is complete. This is very important, otherwise there could be connectionleaks.
Certification Preparation MaterialQuestion: 2You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows CommunicationFoundation (WCF) Data Services service. You discover that when an application submits a PUT or DELETE request tothe Data Services service, it receives an error. You need to ensure that the application can access the service. Whichheader and request type should you use in the application?
Page | 3

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 16 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Winter
Professor
Niall Winters
Tags
NET Framework, Microsoft SQL Server, Microsoft Visual Studio, Microsoft Net Framework

Newly uploaded documents

Show More

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture