get value from radiobutton


/ Published in: VB.NET
Save to your folder(s)

try


Copy this code and paste it in your HTML
  1. Private Sub savebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles savebtn.Click
  2.  
  3. Dim radioValue As String
  4. If Offer1Radbtn.Checked = True Then
  5. radioValue = "offer 1"
  6. ElseIf Offer2Radbtn.Checked = True Then
  7. radioValue = "offer 2"
  8. Else
  9. radioValue = "not selected"
  10. End If
  11.  
  12. daCustomer.Fill(dsCustomer)
  13. Dim Rows As DataRow = dsCustomer.CUSTOMER.NewRow
  14.  
  15. Try
  16. Rows("Telno") = CInt(TelNoTextBox.Text)
  17. Rows("Name") = NameTextBox.Text
  18. Rows("Address") = AddTextBox.Text
  19. Rows("Address") = radioValue '--------------------- contoh.
  20.  
  21. dsCustomer.CUSTOMER.Rows.Add(Rows)
  22. daCustomer.Update(dsCustomer)
  23.  
  24. MessageBox.Show("Record succsesfully saved")
  25. Catch ex As Exception
  26. MessageBox.Show(ex.Message)
  27. End Try
  28. End Sub

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.