PsychoDazey
asked on
Set field to true for all displayed records.
I am using a datagrid (datagrid1) to display records from my sql database on a windows form. One of the fields is a bit datatype (field name = Disabled). This field displays as a check box.
I have a button that filters records based on a criteria that a user enters into a text box. Now I have another button that when clicked, I want to set the disabled field to true for all of the records showing....I am guessing I need to use a foreach statement but I don't know how to do it. Any help?
I have a button that filters records based on a criteria that a user enters into a text box. Now I have another button that when clicked, I want to set the disabled field to true for all of the records showing....I am guessing I need to use a foreach statement but I don't know how to do it. Any help?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks, I'll try that out this morning and get back to you.
You have to use Query like this;
UPDATE <TBL_NAME >
SET <FieldName> = 1
WHERE <FieldName> = Text1.Text
I HOPE THIS IS HELPFUL FOR YOU
REGARDS,
SATYADEV SINGH