PrepAway - Latest Free Exam Questions & Answers

Category: 70-561

Exam 70-561: TS: Microsoft .NET Framework 3.5, ADO.NET Application Development

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 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 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?

Which line of code should you insert at line 08?

You create an application 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 dt = new DataTable();
02 dt.Columns.Add("number");
03 dt.Columns.Add("string");
04 dt.Rows.Add(1, "3");
05 dt.Rows.Add(2, "2");
06 dt.Rows.Add(3, "1");
07 var result = from p in dt.AsEnumerable()
08
09 foreach (var number in result) {
10 Console.Write(number.ToString());
11 }

You need to display the string "321".

Which line of code should you insert at line 08?

Which line of code should you add?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft ADO.NET.

You write the following code segment.

DataTable dt = new DataTable("Strings");
dt = new DataTable();
dt.Columns.Add("Strings");
dt.Rows.Add("A-B");
dt.Rows.Add("C-D");
var c = from Strings in dt.AsEnumerable()
select Strings[0];
int count = 0;

You need to ensure that the value of the count variable is 4.

Which line of code should you add?

Which code segment should you add?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft ADO.NET.

The application contains two entities named Customer and Order. The Customer entity has a navigable property named Orders. The Orders property returns a collection of Order entity instances.

You write the following code segment.

ContosoEntities context = new ContosoEntities();
ObjectQuery<Customer> query;

You need to ensure that each time a Customer entity instance is queried the related Order entity instances are retrieved.

Which code segment should you add?


Page 3 of 812345...Last »