473,323 Members | 1,550 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Help: Using Multiple Checkboxes or Checkboxlist to filter results in a gridview in ASP.NET 2.0 / VS2005

Hello, and Thanks in advance for any light you might shed on my
troubles.

I'm trying to setup a series of checkboxes, or a checkboxlist to
control the results that are shown on a gridview control.

I have a column in my database that hold the current status of the
items in there. If I used a checkboxlist and populate it with my
options, and set the SQL statement on my gridview control to:
"SELECT [DB_ID], [P_Name], [Status], [Stamp] FROM [Patches] WHERE
([Status] = @Status) ORDER BY [Stamp] DESC"

@Status is my checkboxlist control.

It only partially works, if I select only one checkbox, it updates the
page correctly, if I select more than one, only the first one selected
gets shown and the rest are ignored.

I've also tried setting up 5 individual checkbox controls, and changing
my SQL to:
"SELECT [DB_ID], [P_Name], [Status], [Stamp] FROM [Patches] WHERE
Status IN (@Param1, @Param2, @Param3, @Param4, @Param5 ) ORDER BY
[Stamp] DESC"
I've set ConvertEmptyStringToNull on all of these Param's to True and
False. When using the default PropertyName for the Paramater of
Checkbox.checked, I get this error.
"Syntax error converting the varchar value 'mystring' to a column of
data type bit." (I understand why, now, just including what I've done
already)

If I use checkbox.text for the Parameter, it's always active since the
..text property doesn't change dynamically with it being checked or not.
Basically, I have a page that I want users to be able to filter how
much of the page they see by selecting 1 more more checkboxes. Any
suggestions on how I can get this filter up and going?

Dec 29 '05 #1
0 1968

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: john | last post by:
I posted this question to comp.lang.javascript but didn't get a response, so I'll try here. I am using ASP.NET and I have a datagrid. One of the columns in my grid is all checkboxes. When the...
2
by: John Hoge | last post by:
I'm looking for that elusive .net time saving magic. I have an application that presents a list of items which the user can select from. A CheckBoxList works great for that, but I want to query...
1
by: SalamElias | last post by:
When I add checkboxes dynamically, I can set several attributes(id, eventhandlers specific to checkboxes....) in code. I decided to use the checkboxlist to generate several checkboxes dynamically...
0
by: Mike Collins | last post by:
I someone can please help, I am about at an end in trying to figure this out. I am adding some dynamic controls to my page (I found out that I was supposed to be doing that in the oninit event,...
0
by: joebob8000 | last post by:
This seems like a simple task, but my 6 year old roots in classic ASP must be causing me trouble with my current problem. I am looking to provide a search for users in which they can select...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
0
by: mutt1170 | last post by:
I have a checkbox list nested inside a gridview. The gridview pulls its data from an objectdatasource and lists countries. The nested checkbox list is databound to another object datasource and...
0
by: Ned Balzer | last post by:
Hi, Can anyone point me in the direction of a solution for validating multiple checkboxes in an asp.net 2.0 page? 1) This is not a checkboxlist, it is a number of separate checkboxes 2) I do...
3
by: santoshjsh | last post by:
hello everyone, i have a gridview in which i have multiple checkboxes in a single column. means for every row in the gridview i have four checkboxes in one column e.g Add, Delete, Print,...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.