TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
saan mughal
NA
12
0
Sql Statement to Linq
Mar 16 2021 12:55 AM
Hi Everyone,
I am very new to Linq, i have a SQL statement which i want to convert to Linq but I am struggling with it, I will really appreciate any help,
Sql statement:
select cat_name, cat_id, count(pro_fk_cat_id) as count
from
tbl_category c left join tbl_product p on c.cat_id = p.pro_fk_cat_id
group by
cat_name,
cat_id,
pro_fk_cat_id
Linq:
var results = from d in this.objDB.tbl_category
from m in this.objDB.tbl_Product
.Where(m => m.pro_fk_cat_id == d.cat_id)
group (d.cat_id,d.cat_name,m.pro_fk_cat_id)
Reply
Answers (
5
)
linq data from sql table
Getting the previous row value in SQL SERVER