1.
You work as an application developer at Contoso.com. You use Microsoft .NET Framework 3.5 and Microsoft ADO.NET to develop an application that will connect to the Microsoft SQL Server 2005 database. The following contacts.xml file is read by the developed application. Mia Hamm Andy Reid Amy Walsh Your application contains the following code. (Line numbers are for reference only.) 01 XDocument loaded = XDocument.Load(@"D:\contacts.xml"); 02 03 foreach (string name in q) 04 Console.WriteLine("{0}", name); You want to make sure that the application outputs only the names Andy Reid and Amy Walsh. What should you do?
2.
You work as an application developer at Contoso.com. You use Microsoft .NET Framework 3.5 and Microsoft ADO.NET to develop an application. The database on the Microsoft SQL Server 2005 database has two tables that are displayed by using two SqlConnection objects in two different GridView controls. You want the tables to be displayed at the same time with the use a single SqlConnection object. What should you do?
3.
You work as an application developer at Contoso.com. You use Microsoft .NET Framework 3.5 and Microsoft ADO.NET to develop an application. You have completed the following code segment. (Line numbers are for reference only.) 01 private void Init() 02 { 03 SyncConflictResolver scr = new SyncConflictResolver(); 04 scr.ClientUpdateServerUpdateAction = ResolveAction.FireEvent; 05 SqlCeClientSyncProvider csp = new SqlCeClientSyncProvider(); 06 07 } You need to make sure that the application handles synchronization conflicts when data is updated in the database of the application. What should you do?
4.
You work as an application developer at Contoso.com. You use Microsoft .NET Framework 3.5 and Microsoft ADO.NET to develop an application. You have completed the following code segment. DataTable dt = new DataTable("Strings"); dt = new DataTable(); dt.Columns.Add("Strings"); dt.Rows.Add("A-G"); dt.Rows.Add("H-P"); dt.Rows.Add("Q-Z"); var c = from Strings in dt.AsEnumerable() select Strings[0]; int count = 0; You need to make sure that the value of the count variable is 4. What should you do?
5.
You work as an application developer at Contoso.com. You use Microsoft .NET Framework 3.5 and Microsoft ADO.NET to develop an application that will connect to the Microsoft SQL Server 2005 database. Your application contains the following code. (Line numbers are for reference only.) DataTable dt = new DataTable("User"); dt.Columns.Add("ID", typeof(Int32)); dt.Columns.Add("City", typeof(String)); dt.Columns.Add("State", typeof(String)); dt.Rows.Add(1, "UK", "297EU"); dt.Rows.Add(2, "CA", "33NA"); dt.Rows.Add(3, "US", "729NA"); var qry = from s in dt.AsEnumerable() select s["State"]; foreach (string rNum in qry) You need to display only the digits from the State field. What should you do?
6.
You work as an application developer at Contoso.com. You use Microsoft .NET Framework 3.5 and Microsoft ADO.NET to develop an application that will connect to the Microsoft SQL Server 2005 database. Your application contains the following code. 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". What should you do?
7.
You work as an application developer at Contoso.com. You use Microsoft .NET Framework 3.5 and Microsoft ADO.NET to develop an application that will connect to the Microsoft SQL Server 2005 database. You have completed the following code segment. (Line numbers are for reference only.) 01 SqlConnection sqlconn 02 ... 03 SqlDataAdapter ordAdp = new SqlDataAdapter( 04 "SELECT OrderID, CustomerID, OrderDate, Qty, UnitPrice, 05 Discount FROM Sales.OrderDetail", sqlconn); 06 DataSet order_ds = new DataSet(); 07 DataTable order_dt = order_ds.Tables.Add("Orders"); 08 ordAdpt.Fill(order_dt); 09 order_dt.Rows[0].BeginEdit(); 10 // The code here will insert, update and delete rows 11 order_dt.Rows[0].EndEdit(); 12 13 order_dt.AcceptChanges(); You want to validate that every row that has the Qty column value is set to zero before you commit any changes. What should you do?
8.
You work as an application developer at Contoso.com. You use Microsoft .NET Framework 3.5 and Microsoft ADO.NET to develop an application that will connect to the Microsoft SQL Server 2005 database. You have also created the following code segment: DataTable tbl = new DataTable(); DataColumn colId = tbl.Columns.Add("ID", typeof(int)); colId.AutoIncrement = true; tbl.Constraints.Add("Pkey", colId, true); DataColumn colProd = tbl.Columns.Add("Product", typeof(string)); colCtry.DefaultValue = "SKU"; tbl.Columns.Add("Name", typeof(string)); You want to create a new row in the tbl DataTable with the following characteristics: 1. The ID column is set to an auto-incremented value. 2. The Product column is set to the default value. 3. The Name column is set to the value "New Product". What should you do?
9.
You work as an application developer at Contoso.com. You use Microsoft .NET Framework 3.5 and Microsoft ADO.NET to develop an application that will connect to the Microsoft SQL Server 2005 database. The following contacts.xml file is read by the developed application. Mia Hamm Andy Reid Amy Walsh Your application contains the following code. (Line numbers are for reference only.) 01 XDocument loaded = XDocument.Load(@"D:\contacts.xml"); 02 03 foreach (string name in q) 04 Console.WriteLine("{0}", name); You want to make sure that the application outputs only the names Andy Reid and Amy Walsh. What should you do?
10.
You work as an application developer at Contoso.com. You use Microsoft .NET Framework 3.5 and Microsoft ADO.NET to develop an application that will connect to the Microsoft SQL Server 2005 database named DB01 that resides on a server named DB01. You have also created a storage schema definition file named Contoso.ssdl, a conceptual schema definition file named Contoso.csdl and a mapping schema definition file named Contoso.msl. You then modified the content of Contoso.ssdl and Contoso.csdl. You need to generate the .NET Framework entities from the altered schema definitions. What should you do?