Click here to Skip to main content
12,632,234 members (29,924 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# C#4.0
can any one helpfor writing linq querry for below sql statemant?

CREATE Procedure usp_BindQans(@UserName varchar(50))
AS
BEGIN
SELECT T1.QuestionNo, T2.Q_Id, T2.QuestionName, T1.OptionName,T2.Require
FROM
(SELECT T.QuestionNo, STUFF(
(SELECT '$' + A.OptionName
FROM
Qanswers A
WHERE A.QNo = T.QuestionNo
FOR XML PATH('')),1,1,'') AS OptionName
FROM Question T
GROUP BY T.QuestionNo) T1
JOIN Question T2
ON T1.QuestionNo = T2.QuestionNo where T2.UserName=@UserName
end
Posted 7-Feb-13 2:16am
Updated 7-Feb-13 2:24am
Ankur\m/50.5K
v2
Comments
Ankur\m/ 7-Feb-13 7:24am
   
Could you also show us what you tried?

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161208.2 | Last Updated 7 Feb 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100