Which code segment should you use?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a custom control named OrderForm.
You write the following code segment.
Public Delegate Sub CheckOrderFormEventHandler(e As EventArgs)
Private Shared ReadOnly CheckOrderFormKey As New Object()
Public Custom Event CheckOrderForm As CheckOrderFormEventHandler
AddHandler(ByVal value As CheckOrderFormEventHandler)
Events.[AddHandler](CheckOrderFormKey, value)
End AddHandler
RemoveHandler(ByVal value As CheckOrderFormEventHandler)
Events.[RemoveHandler](CheckOrderFormKey, value)
End RemoveHandler
End Event
You need to provide a method that enables the OrderForm control to raise the CheckOrderForm event.
Which code segment should you use?
Which entity SQL query should you use?
You create an application by using Microsoft .NET Framework 3.5. You use Microsoft ADO.NET Entity Framework for persistence.
You write a conceptual schema definition for the entity data model in the following manner.
<EntityType Name="Customer">
<Key>
<PropertyRef Name="CustomerID" />
</Key>
<Property Name="CustomerID" Type="Int32" Nullable="false" />
</EntityType>
<EntityType Name="Order">
<Property Name="InvoiceNo" Type="String" MaxLength="10" FixedLength="true" />
<NavigationProperty Name="Customer" Relationship="ContosoModel.FK_Customer_Order" FromRole="Order" ToRole="Customer" />
</EntityType>
You need to retrieve all the InvoiceNo property values for the Customer entity instance that has the CustomerID property value as 1.
Which entity SQL query should you use?
Which two actions should you perform?
You create an application by using the Microsoft .NET Framework 3.5 and Microsoft ADO.NET. The application uses ADO.NET Entity Framework for persistence.
The following storage schema definition is generated for an entity named Supplier.
<EntityType Name="Supplier">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="Country" Type="char" MaxLength="3" />
<Property Name="City" Type="nvarchar" MaxLength="20" />
</EntityType>
You need to map the City column and the Country column as a separate type named Address in the conceptual schema.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
Which command should you use?
You create an application by using the Microsoft .NET Framework 3.5 and Microsoft ADO.NET.
The application connects to a database named ContosoDB. The database resides on a server named ContosoSrv.
You generate the following files:
A storage schema definition file named Contoso.ssdl
A conceptual schema definition file named Contoso.csdl
A mapping schema definition file named Contoso.msl
You alter the contents of the Contoso.csdl and Contoso.msl files.
You need to generate the .NET Framework entities from the altered schema definitions.
Which command should you use?
Which SQL statement should you insert at line 02?
You are creating a Microsoft Windows Mobilebased application by using the Microsoft .NET Framework 3.5 and Microsoft Synchronization Services for ADO.NET. The application connects to a Microsoft SQL Server 2005 database.
The application uses the SyncAdapter object. You set the InsertCommand command of the SyncAdapter object to a T-SQL statement.
You write the following T-SQL statement. (Line numbers are included for reference only.)
01 INSERT INTO dbo.DiscountType ([DiscountTypeID], [Name], [LastEditDate], [CreationDate]) VALUES (@DiscountTypeID, @Name, @LastEditDate, CreationDate)
02
When the SyncAdapter object executes the InsertCommand command, all the data inserts are identified as conflicts. You discover that these data inserts were synchronized correctly.
You need to ensure that the application can identify successful data inserts.
Which SQL statement should you insert at line 02?
Which property should you use?
You create an application by using the Microsoft .NET Framework 3.5 and Microsoft ADO.NET. The application connects to a Microsoft SQL Server 2005 database.
You plan to implement the exception-handling strategy for the application.
You need to find the SQL Server 2005 exceptions that have a severity level value greater than 19.
Which property should you use?
Which task should your code perform?
You create an application by using the Microsoft .NET Framework 3.5 and Microsoft ADO.NET. The application connects to a Microsoft SQL Server 2005 database.
The application uses a SqlConnection object that is active for the lifetime of a user session.
You need to ensure that the application gracefully handles all the exceptions that cannot be recovered.
Which task should your code perform?
Which parameter/s should you add to the connection string?
You create an application by using the Microsoft .NET Framework 3.5 and Microsoft ADO.NET.
You plan to use Windows Authentication along with the Microsoft OLE DB provider.
You need to ensure that the OLE DB connection is as secure as possible.
Which parameter/s should you add to the connection string?
Which code segment should you use?
You create an application by using the Microsoft .NET Framework 3.5 and Microsoft ADO.NET. The application connects to a Microsoft SQL Server 2005 database.
You run the application under a Least-Privilege User Account (LUA) of the Windows operating system.
You need to configure the SQL Server 2005 connection string in the app.config file to use SQL Server Express user instances.
Which code segment should you use?
Which code segment should you insert at line 16?
You create an application for an online store by using the Microsoft .NET Framework 3.5 and Microsoft ADO.NET.
You write the following code segment. (Line numbers are included for reference only.)
01 DataTable dtProducts = new DataTable();
02 dtProducts.Columns.Add("ProductID");
03 dtProducts.Columns.Add("ProductName");
04 dtProducts.Columns.Add("CategoryID");
05 dtProducts.Rows.Add(1, "Milk", 1);
06 dtProducts.Rows.Add(2, "Beef", 2);
07 dtProducts.Rows.Add(3, "Butter", 1);
08 dtProducts.Rows.Add(4, "Sausage", 2);
09 DataTable dtCategories = new DataTable();
10 dtCategories.Columns.Add("CategoryID");
11 dtCategories.Columns.Add("CategoryName");
12 dtCategories.Rows.Add(1, "Dairy products");
13 dtCategories.Rows.Add(2, "Meat");
14 var products = dtProducts.AsEnumerable();
15 var categories = dtCategories.AsEnumerable();
16
17 foreach (var element in result) {
18 Console.WriteLine(element);
19 }
When the dtProducts DataTable has the same value in the CategoryID column as the dtCategories DataTable, the DataTables are related.
You need to display for each product, the product information and the product category.
Which code segment should you insert at line 16?