Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL statement in SQLDataSource issue

Author  Topic 

keithroby
Starting Member

6 Posts

Posted - 2008-11-19 : 12:28:12
Here's a beginner's question for you...

I have a checkbox list so that the user can select multiple filter options.

Here's my SQL Statement configured to my SQLDataSource object:

SELECT AVG(SessionFlow) AS SessionFlow, AVG(Materials) AS Materials, AVG(CBT) AS CBT, AVG(Activities) AS Activities, AVG(ClarityOfInfo) AS ClarityOfInfo, AVG(ClassLength) AS ClassLength, AVG(AnswerQs) AS AnswerQs, AVG(Patience) AS Patience, AVG(Presentation) AS Presentation, AVG(Knowledge) AS Knowledge, AVG(Timeliness) AS Timeliness, AVG(Preparedness) AS Preparedness, AVG(Motivation) AS Motivation, AVG(Participation) AS Participation FROM View_3 WHERE (Course = @Course) AND (Instructor = @Instructor) AND (CourseDate >= @CourseDate) AND (CourseDate <= @CourseDate2)



What I'd like to do is make it so that the Course object (Checkbox List) can be checked multiple times (Check multiple courses in the list).

As it stands now, this statement will return results on the top-most item in the Course list.

Any ideas as to how to gain full functionality here?

Thanks!

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-19 : 12:33:01
[code]SELECT AVG(SessionFlow) AS SessionFlow, AVG(Materials) AS Materials, AVG(CBT) AS CBT, AVG(Activities) AS Activities, AVG(ClarityOfInfo) AS ClarityOfInfo, AVG(ClassLength) AS ClassLength, AVG(AnswerQs) AS AnswerQs, AVG(Patience) AS Patience, AVG(Presentation) AS Presentation, AVG(Knowledge) AS Knowledge, AVG(Timeliness) AS Timeliness, AVG(Preparedness) AS Preparedness, AVG(Motivation) AS Motivation, AVG(Participation) AS Participation FROM View_3 WHERE ( ','+ @Course+',' LIKE '%,'+Course+',%') AND (Instructor = @Instructor) AND (CourseDate >= @CourseDate) AND (CourseDate <= @CourseDate2)[/code]
Go to Top of Page

keithroby
Starting Member

6 Posts

Posted - 2008-11-19 : 12:43:13
Thanks for your reply!

That is achieving the same result I have now, which tells me I probably have done something else wrong.

It's still only returning results from the top most item in the returned list.
Go to Top of Page

keithroby
Starting Member

6 Posts

Posted - 2008-11-19 : 12:49:05
I am thinking there's an additional property I need to set on the CheckboxList web control on the page?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-19 : 12:58:40
if you've sql profiler check if comma seperated values are passed when you select multiple checkboxes
Go to Top of Page

keithroby
Starting Member

6 Posts

Posted - 2008-11-19 : 13:12:01
I'm running Visual Studio 2008 - I'm not sure how to activate SQL Profiler.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-20 : 01:07:43
quote:
Originally posted by keithroby

I'm running Visual Studio 2008 - I'm not sure how to activate SQL Profiler.


profiler comes with sql server

Go to
start-> All programs->Microsoft sql server 2005/2008->Performance Tools->Sql Profiler
to launch it
Go to Top of Page
   

- Advertisement -