VB data base problem..

janu123

Member
Joined
Mar 11, 2012
Messages
8
Programming Experience
Beginner
hi..

Am actually doing a project where we are supposed to connect a database on VB...I have done all that but the part am stuck is am supposed to have 2 radio button ..one to display full time workers, the other to display halftime workers...there is a column called Full_time which is set to true false. so in the runtime mode when i select the full time workers i only need to view Full_time workers (only the cheked fields) and when i click half time workers it displays the Full_time fields which are all unchecked. Any hints or suggestions how to do? I hope i made it clear....

thank you guys,,,
Untitled.jpg
 
Your query needs to include a parameter that will be used to filter the data, i.e. in the WHERE clause. That filter will be set appropriately before executing the query based on which RadioButton is Checked.
 
Your query needs to include a parameter that will be used to filter the data, i.e. in the WHERE clause. That filter will be set appropriately before executing the query based on which RadioButton is Checked.

i created a query as follows...

SELECT ID, Last_Name, First_Name, Full_Time, Hire_Date, Salary FROM dbo.SalesStaff
WHERE Full_Time= 'true'

after i created this query ..toolstrip appeared in the form which made the query work perfectly the way i want ..but i want this query linked to a radio button

Thank you for you ideas ...am a beginner so this might be very basic ..sorry about that
 
That is not a parameter. That is just a condition. You need to use a parameter in the condition so that you can pass in different values at different times. You use the CheckBoxes to decide what value to assign to the parameter and then that value gets passed into the query and used in the condition. Follow the Blog link in my signature and check out my post on Parameters In ADO.NET.
 
Back
Top