.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> VB.Net >> Post New QuestionBookmark and Share Subscribe to Forum

How to save radiobutton value to database

Posted By: srini     Posted Date: November 18, 2010    Points:2   Category :VB.Net
Hi,

I am developing Application for conducting Test. I am using VB.net and database as SQL Server 2005. In a form,i am having 10 questions and for each question,there are four optional for answers.

"RadioButton" has been used for answers option.

Suppose the user can select any one of the radiobutton option for each questions(i.e. For all 10 questions) and click save button,it should be stored in SQL SERVER 2005 database.

hELP mE!

Responses
Author: Dhivakaran             
Posted Date: November 22, 2010     Points: 5   

Hi Srini,

Use the below code .

in html page

<asp:RadioButtonList ID="rbtnqn1" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Text="Answer1" Value="Answer1"></asp:ListItem>
<asp:ListItem Text="Answer2" Value="Answer2"></asp:ListItem>
<asp:ListItem Text="Answer3" Value="Answer3"></asp:ListItem>
<asp:ListItem Text="Answer4" Value="Answer4"></asp:ListItem>
</asp:RadioButtonList>

then use the below code for selected value.

rbtnFstatus.SelectedValue.ToString();

-
Dhivakaran T


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend