Click here to Skip to main content
15,890,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HTML
SELECT p.Pro_id,
p.Pro_Name,
i.ImageUrl,
pr.Price,
pb.ProBid_price,
d.Discrption,
l.Username,
sh.StartDate,
sh.StartTime,
sh.CloseDate,
sh.CloseTime 

FROM
Tbl_Product p,
Tbl_Image i,
Tbl_Price pr,
Tbl_ProBidPrice pb,
Tbl_Discription d,
Tbl_Login l,
Tbl_BidPlace bp,
Tbl_Schedule sh

where
i.Pro_id=p.Pro_id and
pr.Pro_id=p.Pro_id and
pb.Pro_id=p.Pro_id and
d.Pro_id=p.Pro_id and
sh.Pro_id=p.Pro_id and
l.L_id=bp.L_id and
bp.Bidplace_id = (select max(bp.Bidplace_id) from Tbl_BidPlace bp where bp.Pro_id = P.Pro_id) and
p.Pro_id='" + Request.QueryString["Pro_id"] + "' ";


how can i use this query as a linq query....
please give me solution
thank you
Posted

For converting SQL Query to LINQ and Vice-Versa you can use Linqer.Exe
In this software even you can Check the output also.You Just need to give a dbml file and a designer file path while configuring.
 
Share this answer
 
Comments
Rishikesh_Singh 29-Feb-12 12:27pm    
thanks didn't know about this..
 
Share this answer
 
try this format code and do some adjustment regarding to your need

C#
YourEntities ctx = new YourEntities();

var query = from p in ctx.Tbl_Product
                 
	join img in ctx.Tbl_Image on p.Pro_Id equals img.Pro_Id
	join pr in ctx.Tbl_Price on p.Pro_Id equals pr.Pro_Id
	join pb in ctx.Tbl_ProBidPrice on p.Pro_Id equals pb.Pro_Id
	join d in ctx.Tbl_Discription on p.Pro_Id equals d.Pro_Id
	join l in ctx.Tbl_Login on p.Pro_Id equals l.Pro_Id
	join bp in ctx.Tbl_BidPlace on p.Pro_Id equals bp.Pro_Id
	join sh in ctx.Tbl_Schedule on p.Pro_Id equals sh.Pro_Id              
                 
select new 
{ 

p.Pro_Name,
i.ImageUrl,
pr.Price,
pb.ProBid_price,
d.Discrption,
l.Username,
sh.StartDate,
sh.StartTime,
sh.CloseDate,
sh.CloseTime 
};


vote and accept
If this will help you
Thanks (n_n)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900