MCPD-ASP-NET-Developer-Upgrade-(70-356).pdf - Microsoft 70-356 MCPD ASP.NET Developer Upgrade http\/killexams.com\/exam-detail\/70-356 Reference QUESTION

MCPD-ASP-NET-Developer-Upgrade-(70-356).pdf - Microsoft...

This preview shows page 1 - 4 out of 8 pages.

70-356 Microsoft MCPD ASP.NET Developer Upgrade
Image of page 1
Reference: QUESTION 112You work as an application developer at Contoso.com. You use Microsoft .NET Framework 3.5 and MicrosoftADO.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? A. Use the following code:count =c.Select(str => ((string)str).Replace('-', '\n')).Count();B. Use the following code:count =c.SelectMany(str => ((string)str).Replace('-','\n')).Count();C. Use the following code:count = c.Select(str => ((string)str).Split('-')).Count();D. Use the following code:count =c.SelectMany(str => ((string)str).Split('-')).Count(); Reference:QUESTION 113You work as an application developer at Contoso.com. You use Microsoft .NET Framework 3.5 and MicrosoftADO.NET to develop an application that will connect to the Microsoft SQL Server 2005 database. Yourapplication 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? A. Add the following code segment:Console.WriteLine(rNum.Select(delegate(char s) { return char.IsDigit(s); })); B. Add the following code segment:Console.WriteLine(rNum.Select(s => char.IsDigit(s))); C. Add the following code segment: 83
Image of page 2
Console.WriteLine(rNum.Select(s => char.IsDigit(s)?s:'\0')); D. Add the following code segment:Console.WriteLine(rNum.Select(delegate(char s, int p) { return p.CompareTo(s); }));
Image of page 3
Image of page 4

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture