How can you find average of student marks from student tables (columns are studentid, marks)?
Answer / Vinay Sharma
You can use LINQ to calculate the average of student marks by using the Average() method in combination with From clause and the Where clause to filter the records. Here's an example: `var averageMarks = dbContext.Students.Where(student => student.StudentId > 0).Average(student => student.Marks);`
| Is This Answer Correct ? | 0 Yes | 0 No |
What is expression tree in linq?
Explain what is linq?
What are the three main components of linq?
What is the advantage of linq over stored procedures?
What are the different ways to write linq query syntax?
How can we find sequence of items in two different array (same type) in the same order using linq query?
Explain how LINQ is useful than Stored Procedures?
What is linq in ado net?
What is system linq?
What is linq used for?
What is the Difference between LINQ and Stored Procedures?
1 Answers Sans Pareil IT Services,
Write a program using linq to find the sum of first 5 prime numbers?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)