Integrate Data in a Windows Forms Application

These questions are based on 70-526VB: TS: Microsoft .NET Framework 2.0 – Windows-Based Client Development (VB.NET)
Microsoft
Self Test Software Practice Test


Objective: Integrate data in a Windows Forms application.
Sub-objective: Manage connections and transactions.


Single answer, multiple-choice


You are an application developer for a company. You are creating a Windows application that will be used by your employees of your company to manage a SQL Server database Sales.


The Sales database is stored on a Microsoft SQL Server 2005 instance named SqlServer1. As per your database administrator’s recommendation to manage SqlServer1 instance performance, the maximum number of connections to the SqlServer1 instance should be 100. You decide to establish a connection with the Sales database and implement connection pooling.


Which code should you use to establish the connection with the Sales database?



  1. Dim con As New System.Data.SqlClient.SqlConnection
    con.ConnectionString = “Data Source=SqlServer1;” & _
     ”Integrated Security=true;Initial Catalog=Sales;” & _
     ”Pooling=true;Max Pool Size=100;Min Pool Size=1;”
    con.Open()

  2. Dim con As New System.Data.SqlClient.SqlConnection
    con.ConnectionString = “Data Source=SqlServer1;” & _
     ”Integrated Security=true;Initial Catalog=Sales;” & _
     ”Pooling=true;”
    con.Open()

  3. Dim con As New System.Data.SqlClient.SqlConnection
    con.ConnectionString = “Data Source=SqlServer1;” & _
     ”Integrated Security=true;Initial Catalog=Sales;” & _
     ”Pooling=true;Max Pool Size=100;Min Pool Size=0″
    con.Open()

  4. Dim con As New System.Data.SqlClient.SqlConnection
    con.ConnectionString = “Data Source=SqlServer1;” & _
     ”Integrated Security=true;Initial Catalog=Sales;” & _
     ”Pooling=true;Max Pool Size=1;Min Pool Size=100;”
    con.Open()

Answer:
A. Dim con As New System.Data.SqlClient.SqlConnection
con.ConnectionString = “Data Source=SqlServer1;” & _
 ”Integrated Security=true;Initial Catalog=Sales;” & _
 ”Pooling=true;Max Pool Size=100;Min Pool Size=1;”
con.Open()


Tutorial:
You should use the following code:


Dim con As New System.Data.SqlClient.SqlConnection
con.ConnectionString…


cmadmin

ABOUT THE AUTHOR

Posted in Uncategorized|

Comment:

Powered by WebDesk