News
IBM to offer mobile security as a service IBM will start delivering mobile security-as-a-service (MaaS) through its own cloud infrastructure in India, a move that is expected to better address in-country data requirements... IBM Spectrum Computing: IBM has enlarged its portfolio of software-defined infrastructure solutions with cognitive features for workload management.  * LiFi internet technology has been introduced, the new type of wireless internet connection that gives 100 times faster than traditional WiFi -- Invented by Professor Harald Haas from the University of Edinburgh. * Sci. Rachid Yazami has developed a smart chip that charges smartphones in less than 10 minutes. BenQ has launched BlueCore projector - Consumer electronics major BenQ has launched its first BlueCore laser light source projector. For those unaware, devices with BlueCore laser technology have a high contrast output of 80000:1 with an extended lamp life and efficiency. *** 
Category - Entity Framework and LINQ Interview Questions
 
1. Explain what is LINQ? Why is it required?
Ans:
  • Language Integrated Query or LINQ is the collection of standard query operators which provides query facilities into.NET framework language like C#, VB.NET.
  • LINQ is required as it bridges the gap between the world of data and world of objects.

2. What are the types of LINQ?
Ans:
  • LINQ to Objects
  • LINQ to XML
  • LINQ to Dataset
  • LINQ to SQL
  • LINQ to Entities

3. Explain how LINQ is useful than Stored Procedures?
Ans:
  • Debugging: It is difficult to debug a stored procedure but as LINQ is part of.NET, visual studios debugger can be used to debug the queries
  • Deployment: For stored procedure, additional script should be provided but with LINQ everything gets compiled into single DLL hence deployment becomes easy
  • Type Safety: LINQ is type safe, so queries errors are type checked at compile time

4. Why Select clause comes after from clause in LINQ ?
Ans:
The reason is, LINQ is used with C# or other programming languages, which requires all the variables to be declared first. From clause of LINQ query just defines the range or conditions to select records. So that’s why from clause must appear before Select in LINQ.

5. What is the extension of the file, when LINQ to SQL is used?
Ans:
The extension of the file is .dbml

6. What is the benefit of using LINQ on Dataset?
Ans:
  • The main aim of using LINQ to Dataset is to run strongly typed queries on Dataset.
  • Suppose we want to combine the results from two Datasets, or we want to take a distinct value from the Dataset, then it is advisable to use LINQ.
  • Normally you can use the SQL queries to run on the database to populate the Dataset, but you are not able to use SQL query on a Dataset to retrieve a particular values. To get this you need to use ADO.NET functionalities. But, in case of LINQ, it provides more dignified way of querying the Dataset and provides some new features as compared to ADO.NET.

7. What is the disadvantage of LINQ over stored procedures?
Ans:
The disadvantage with LINQ is, it is not a precompiled statement where as stored procedures are precompiled. In case of LINQ the queries need to be compile before the execution. So according to this, I can say stored procedures are faster in performance as compared to LINQ.

8. List out the three main components of LINQ? Explain what is the extension of the file, when LINQ to SQL is used?
Ans:
Three main components of LINQ are
  • Standard Query Operators
  • Language Extensions
  • LINQ Providers
  • The extension of the file used is .dbml

9. Define what is Where clause and Let clause?
Ans:
  • Where clause: It allows adding some conditional filters to the query.
  • Let clause: It allows defining a variable and assigning it a value calculated from the data values.

10. Explain why SELECT clause comes after FROM clause in LINQ?
Ans:
With other programming language and C#, LINQ is used, it requires all the variables to be declared first. “FROM” clause of LINQ query defines the range or conditions to select records. So, FROM clause must appear before SELECT in LINQ.

123
Search
Recent Posts
Create Amazon ElasticCache Using Memcached in CSharp
Oct 29 2018 12:09PM Posted By Amose
Get Google Map Lat Lng (Geo Point) By Pincode in C#
Oct 28 2018 12:09PM Posted By Pranav
Google URL Shortener in C#
Oct 20 2018 12:09PM Posted By Sanjay
Bind Gridview from CSV file in Asp.Net C#
Oct 5 2018 12:09PM Posted By Michael
Call WebService method from jQuery in every 1 minute
Sep 26 2018 12:09PM Posted By John
Gridview custom CSS in ASP.Net
Sep 14 2018 12:09PM Posted By Micheal Ryan
Read excel file and bind to Gridview in C#
Sep 10 2018 12:09PM Posted By Micheal
Tags
Follow us on Facebook
Follow us on Google +
Recent post in your Email inbox.
Enter your email address: