Return to Snippet

Revision: 53673
at December 1, 2011 00:41 by javageget


Initial Code
Private Sub savebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles savebtn.Click

        Dim radioValue As String
        If Offer1Radbtn.Checked = True Then
            radioValue = "offer 1"
        ElseIf Offer2Radbtn.Checked = True Then
            radioValue = "offer 2"
        Else
            radioValue = "not selected"
        End If

        daCustomer.Fill(dsCustomer)
        Dim Rows As DataRow = dsCustomer.CUSTOMER.NewRow

        Try
            Rows("Telno") = CInt(TelNoTextBox.Text)
            Rows("Name") = NameTextBox.Text
            Rows("Address") = AddTextBox.Text
            Rows("Address") = radioValue '--------------------- contoh.

            dsCustomer.CUSTOMER.Rows.Add(Rows)
            daCustomer.Update(dsCustomer)

            MessageBox.Show("Record succsesfully saved")
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
    End Sub

Initial URL


Initial Description
try

Initial Title
get value from radiobutton

Initial Tags


Initial Language
VB.NET