how to insert radiobutton value into Access database using c#?
rely need help...

First question, do you already have the connection setup in your C# application to the Access DB?

Second Question, are you already passing information to the Access DB from your C# application?

If (first == "yes" && second == "yes")... sorry, but um ya if you answered yes to both of those questions then I'm assuming you're just looking to find out how to read the value of the radiobutton.

If the answers are no, then your question is how to establish the connection and pass data from the app to Access?

If it's the first, then there's 3 pieces of information (generally) that are of any use in a radiobutton (4 if you include the group that it belongs to), it's name, text and it's checked state.

First, make sure the RadioButton's permission is set to anything except private.

  • Obtaining the checked state is simple by using radioBoxName.Checked you will return a bool value.
  • The radiobox name is radioBoxName.Name which returns a string value.
  • The radiobox text (what is shown on the user end) is radioBoxName.Text which also returns a string value.

A solid tutorial for setting up your connection properties to connect to the Access Database can be found HERE and then from there it's just a matter of passing the collected variables to the required table/row/columns.

Hope this helps to some degree. The request was somewhat vague so I'm sorry if I went into too much beginner level detail but I wasn't sure from the request what level of assistance you needed. One thing to note is that in order to access the radiobutton attributes on the form, the form itself will need to be initialized within the back end programming so you can access the radiobutton in the format formname.radioname.attributename.

Mark as solved if this clears up your issue :)

I'm not using application..I'm developing web-based..i want to get radioButton value into database access..can u told me how to get that?if you have any suggestion website I'll appreciate that..

The same should apply whether it's a web app or a windows app. the only difference is that the radiobox doesn't need to have permission set on it. And I stand by the link in my previous response for the method involved in connecting to the Access DB :)

As a side note, if this is web-app related, it probably should have been posted in the ASP.Net forum instead of the C# forum.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.