there is a checkbox based on selection i need to fetch data from back end. there is a creditunits field is there in sql table that having values 0 to 5. in C# i need.

there is a checkbox based on selection i need to fetch data from back end. there is a creditunits field is there in sql table that having values 0 to 5.
so when i check checkbox creditunits value is greter than 0 to display, when not checked no filter.
srikanth tirunahariAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongCommented:
we got no idea how you're going to fetch your data...

but when you're doing the submission (like posted back), you need to validate the checked state of your checkbox, and then passing it as a parameter or as a condition when you trying to fetch your data.
0
Kyle AbrahamsSenior .Net DeveloperCommented:
assuming you're doing a stored procedure you could do something like

create procedure getCredentials
@CredentialType int = null
as

select * from tblCredentials where
(@CredentialType is null or CrednetialType >= @credentialType)

Open in new window


Then if the checkbox is checked pass in 1, otherwise don't pass anything in (or pass in a 0).
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Kyle AbrahamsSenior .Net DeveloperCommented:
Auto Close
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.