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
vidhya
NA
324
88.5k
How do i call my stored procedure in mvc3 razor application
Jul 2 2013 2:22 AM
this is my stored procedure which i created. I added in my .edmx file by clicking "update database model".
How do i call the procedure in mvc3razor application using c#.
CREATE PROCEDURE GetGradeBook
AS
BEGIN
DECLARE @AssignmentList varchar(3000),@Sql varchar(max)
SET @AssignmentList =STUFF((SELECT DISTINCT ',[' + assignmentname + ']' FROM assignment where coursesectionid='b78a6efe-ac77-4e49-806a-fc2fad71068b' FOR XML PATH('')),1,1,'')
SET @Sql ='select *
from
(
select p.firstname,p.lastname,a.assignmentname,a.pointspossible
from person2 p
inner join coursesectionroster cs
on cs.personid = p.personid
inner join assignment a
on a.coursesectionid = cs.coursesectionid
left join assignmentsubmission asg
on a.assignmentid=asg.assignmentid
where cs.coursesectionid=''b78a6efe-ac77-4e49-806a-fc2fad71068b''
and cs.courserole=2
)t
PIVOT(SUM(pointspossible) FOR assignmentname IN(' + @AssignmentList + '))p'
EXEC (@SQL)
END
Reply
Answers (
15
)
how to bind data list in asp.net
working with dataset