Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to store radiobutton selected item into database using Windows form C#
Posted

1 solution

It depends on the number of options you have in the radio button group.

If you have two radio buttons and the user can choose any one, you can use a boolean flag in the database.
Convert the user selection choice (i.e. radiobutton 1 or 2) and then make one selection represent bool true and the other false.
Just save this bool flag in the table. Do a reverse transform when fetching values from the table.

For more than two radio button choices, you can use an enumeration in the code.
Each enum value will correspond to number that you can store in the table.
Retrieving values will be done using the same enumeration.
 
Share this answer
 
Comments
rockpune 2-Jul-12 4:06am    
sir give me one example by using two radiobuttons
Abhinav S 2-Jul-12 4:07am    
This forum may offer some help - http://www.vbforums.com/showthread.php?t=311478.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900