News:

SQL Table To C# Entity Model ConverterEntity Model (Class Properties) to SQL Table ConverterIf you encounter any trouble visiting our site, please contact us.

Online Test Knowledge of .Net Framework 4.0 Skills

List<string> alphabets = new List<string>() { "whats", "new", "in", "aspnet" };   

var alphabetsquery = from alphabet in alphabets select alphabet.Substring(0, 1);   

foreach (var alpha in alphabetsquery)   

{     

Response.Write(alpha);   

}

  1. Wnia

  2. Whats

  3. Whatsnewinaspnet

  4. aspnetinnewwhats

Answer: Answer is a

  1. var query = from word in wordsgroup word.ToUpper() by word.Length into grorderby gr.Keyselect new { Length =3, Words = gr };

  2. var query = from word in wordswhere word.Length==3group word.ToUpper() by word.Length into grorderby gr.Keyselect new { Length = gr.Key, Words = gr };

  3. var query = words.GroupBy(w => w.Length, w => w.ToUpper()).Select(g => new { Length = g.Key, Words = g }).OrderBy(o => o.Length);

Answer: Answer is b

  1. LinqDataSource

  2. XmlDataSource

  3. AccessDataSource

  4. EntityDataSource

  5. All of the above are valid data sources

Answer: Answer is e
Further Reading:

Useful resources,Data Source Controls


int[] source = { 7, 4, 1, 3, 9, 8, 6, 7, 2, 1, 8, 15, 8, 23} and sort the elements in descending order using LINQ in Asp.Net framework 4.0. Which of the following statements can you use?

  1. var result = (from s in source orderby s select distinct s).Descending();

  2. var result = (from s in source orderby s descending select s).Distinct();

  3. var result = select distinct s from s in source sortby s descending;

  4. var result = from s in source orderby s descending group p by s select s;

Answer: Answer is b

namespace ExtensionMethods
{
public static class NumericExtensionMethods
{
  public static bool IsNumeric(this string s)
  {
    float output;
    return float.TryParse(s, out output);
  }
}
}

After adding the namespace, how will you call the ExtensionMethod on the string if your string variable is defined as:
string test="4";

  1. test.IsNumeric();

  2. ExtensionMethods.NumericExtensionMethods.IsNumeric();

  3. NumericExtensionMethods m = new NumericExtensionMethods();m.IsNumeric(test);

  4. None of the above

Answer: Answer is a

  1. It is used to add functional handles to elements or provide state information about a control

  2. It is the base class for elements that apply effects onto or around a single child element, such as Border or Viewbox

  3. It provides a set of services that can be used to extend the functionality of a common language runtime property.

  4. It is a property with the exception that its value cannot be set outside the class that declared the read-only property

Answer: Answer is b
Further Reading:

Useful resources,Decorator


  1. <%: ViewData["CurrentTime"] %>

  2. <%=ViewData["CurrentTime"] %>

  3. %ViewData["CurrentTime"] %

Answer: Answer is b
Further Reading:

Useful resources,Passing ViewData from Controllers to Views


  1. Readability

  2. Modifiability

  3. Category

  4. Both a and b

  5. All of the above are Localizability attributes

Answer: Answer is e
Further Reading:

Useful resources,Localization Attributes and Comments


  1. The response will be the first two product entries from the collection of all products after sorting the collection in descending order of Rating.

  2. The response will be the third and fourth product entries from the collection of all products after sorting the collection in ascending order of Rating.

  3. The response will be the second and third product entries from the collection of all products after sorting the collection in descending order of Rating.

Answer: Answer is b
Further Reading:

Useful resources,Accessing Data Service Resources


var scoreRecords = new[] { new {Name = "Alice", Score = 50},
    new {Name = "Bob" , Score = 40},
    new {Name = "Cathy", Score = 45}
  };

var scoreRecordsDict = scoreRecords.ToDictionary(sr => sr.Name);

Response.Write(scoreRecordsDict["BoB"]);
  1. { Name = Bob}

  2. { Name = Bob, Score = 40 }

  3. Name = Bob

  4. None of the above

Answer: Answer is d
Further Reading:

Useful resources, It will report error “The given key was not present in the dictionary.”


Advertisement

BCS Preparation now even more easy. ReadBD is the place where you can find all kind of resources to be successful in BCS,Bank,Islami Bank exam and interview.

Looking for job. Try JobLoader- First ever job search engine in Bangladesh. All open bd jobs now a single mouse click away.

;