ASP NET Questions - Set 9

1)   In a SQL Statement while working with SqlCommand it returns a single value, at that time which method of Command Object will be used?

a. ExecuteNonQuery
b. ExecuteReader
c. ExecuteScalar
d. All of the above
Answer  Explanation 

ANSWER: ExecuteScalar

Explanation:
No explanation is available for this question!


2)   According to the given below statements, choose the correct option. Statement 1: Application caching is the process of storing data (and not pages) in a cache object. Statement 2: Page output caching stores a rendered page, portion of a page, or version of a page in memory. Statement 3: Caching reduces the time required to render cached page in future requests.

a. Only statement 1 is correct.
b. Statement 2 and 3 are correct.
c. Only statement 3 is correct.
d. All statements are correct.
Answer  Explanation 

ANSWER: All statements are correct.

Explanation:
No explanation is available for this question!


3)   Which LINQ statement defines the range variable in a LINQ query?

a. from
b. select
c. join
d. where
Answer  Explanation 

ANSWER: from

Explanation:
No explanation is available for this question!


4)   Which query expression is used to limit the number of results?

a. Skip
b. Take
c. Where
d. Select
Answer  Explanation 

ANSWER: Take

Explanation:
No explanation is available for this question!


5)   Which interface defines the basic extension methods for LINQ?

a. IComparable
b. IList
c. IEnumerable
d. IQueryable
Answer  Explanation 

ANSWER: IEnumerable

Explanation:
No explanation is available for this question!


6)   What LINQ expressions are used to shape results in a query? 1. where 2. select 3. join 4. group

a. 2, 4
b. 1, 2
c. 3, 4
d. None
Answer  Explanation 

ANSWER: 2, 4

Explanation:
No explanation is available for this question!


7)   What types of shapes can LINQ query results be shaped into? 1. Collections of primitive types 2. Collections of complex types 3. Single types 4. Collections of anonymous types

a. 1, 2, 4
b. 1,2,3
c. 1,3,4
d. None of the above
Answer  Explanation 

ANSWER: 1, 2, 4

Explanation:
No explanation is available for this question!


8)   Which LINQ statement is used to merge two data sources to perform queries?

a. where
b. select
c. join
d. group
Answer  Explanation 

ANSWER: join

Explanation:
No explanation is available for this question!


9)   Which LINQ keyword is used to categorize results in a query?

a. where
b. select
c. join
d. group
Answer  Explanation 

ANSWER: group

Explanation:
No explanation is available for this question!


10)   Which of the following statements is true?

a. LINQ to SQL works with any database.
b. LINQ to SQL works with SQL Server.
c. LINQ to SQL is a CLR feature.
d. LINQ to SQL is a SQL Server feature.
Answer  Explanation 

ANSWER: LINQ to SQL works with SQL Server.

Explanation:
No explanation is available for this question!


11)   LINQ query can work with?

a. DataSet
b. List
c. Array
d. All of the above
Answer  Explanation 

ANSWER: All of the above

Explanation:
No explanation is available for this question!


12)   How you can merge the results from two separate LINQ queries into a single result set.

a. Use the ToList method.
b. Use the DataContractJsonSerializer class.
c. Use the XElement class.
d. Use the Concat method.
Answer  Explanation 

ANSWER: Use the Concat method.

Explanation:
No explanation is available for this question!


13)   Which of the following objects represents a LINQ to SQL O / R map?

a. DataSet
b. XElement
c. ObjectContext
d. DataContext
Answer  Explanation 

ANSWER: DataContext

Explanation:
No explanation is available for this question!


14)   What is lamda expression? 1. Anonymous function 2. Can be used to create delegates 3. Named function 4. None

a. 1, 2
b. 1, 2, 3
c. 1, 3
d. 4
Answer  Explanation 

ANSWER: 1, 2

Explanation:
No explanation is available for this question!


15)   Choose the correct one

a. The lambda must contain the same number of parameters as the delegate type.
b. The lambda should not contain the same number of parameters as the delegate type.
c. The return value of the lambda (if any) must be explicitly convertible to the delegate's return type
d. None of the above
Answer  Explanation 

ANSWER: The lambda must contain the same number of parameters as the delegate type.

Explanation:
No explanation is available for this question!


16)   Choose the correct one.

a. The return value of the lambda (if any) must be explicitly convertible to the delegate's return type
b. Each input parameter in the lambda must be implicitly convertible to its corresponding delegate parameter.
c. Lamda expression does not work with LINQ.
d. None of the above
Answer  Explanation 

ANSWER: Each input parameter in the lambda must be implicitly convertible to its corresponding delegate parameter.

Explanation:
No explanation is available for this question!


17)   Choose the correct one

a. Variables introduced within a lambda expression are not visible in the outer method.
b. Variables introduced within a lambda expression are visible in the outer method.
c. The lambda should not contain the same number of parameters as the delegate type.
d. None of the above
Answer  Explanation 

ANSWER: Variables introduced within a lambda expression are not visible in the outer method.

Explanation:
No explanation is available for this question!


18)   Choose the correct option.

a. Dynamic type is non - static type.
b. Dynamic type is static type.
c. Implicit conversion does not work with type dynamic.
d. None of the above
Answer  Explanation 

ANSWER: Dynamic type is static type.

Explanation:
No explanation is available for this question!


19)   Which of the following statement is correct?

a. Anonymous types are class types that derive directly from object.
b. Anonymous types are not class types that derive directly from object.
c. Anonymous types are class types that derive directly from System.Class.
d. None of the above
Answer  Explanation 

ANSWER: Anonymous types are class types that derive directly from object.

Explanation:
No explanation is available for this question!


20)   What types of Objects can you query using LINQ?

a. DataTables and DataSets
b. Any .NET Framework collection that implements IEnumerable(T)
c. Collections that implement interfaces that inherit from IEnumerable(T)
d. All of the above
Answer  Explanation 

ANSWER: All of the above

Explanation:
No explanation is available for this question!