Advertisement

10.25.2007 at 08:19AM PDT, ID: 22917807
[x]
Attachment Details

How to display a SQL variable as CheckBoxField in .Net 2005

Asked by keithwilson1 in Visual Studio .NET 2005, MS SQL Server

Tags: checkboxfield, sql, display, variable

In the script below I have created a sql variable called "Assigned" with the values of 1 or 0.  I have tried to use a SqlDataSource to display this variable as a CheckBoxField but it default to a BoundField.  Could some one give me the HTML to make this variable work as a CheckBoxField.
CREATE    PROCEDURE ssrSP_getCourse_Campus
 @CourseNum as varchar(10),
 @SessionNum as int,
 @yrId as int=5
AS
select
 sc.schoolId as CampusId,
 sc.schcode,
 sc.SchoolName,
 cc.courseNumber,
 (select count(*)
      from course_type_session ct
       join schoolSession ss on ct.schoolSessionId = ss.schoolSessionId
       join Session s on ss.SessionId = s.Id
       join course c on c.Id = ct.courseId
      where c.coursenumber = cc.courseNumber
       and c.schoolCode = sc.schCode
       and s.SchYearId  = @yrId
       and s.SessionNo = @SessionNum) as CntSession,
CASE
      WHEN  exists(select 1
      from course_type_session ct
       join schoolSession ss on ct.schoolSessionId = ss.schoolSessionId
       join Session s on ss.SessionId = s.Id
       join course c on c.Id = ct.courseId
      where c.coursenumber = cc.courseNumber
       and c.schoolCode = sc.schCode
       and s.SchYearId  = @yrId
       and s.SessionNo = @SessionNum) THEN  1
      ELSE  0
   END as Assigned
 
from school sc
 join course_catalog cc on sc.academiclevelid = cc.Academiclevelid
where cc.coursenumber = @CourseNum
 and sc.SSCampus = 1
 and sc.Active = 1
 and sc.schoolYearId = @yrId
GO
Start Free Trial
[+][-]10.25.2007 at 10:52AM PDT, ID: 20149650

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Studio .NET 2005, MS SQL Server
Tags: checkboxfield, sql, display, variable
Sign Up Now!
Solution Provided By: authentify
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628