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();
Get answer to your question and much more
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