/ Published in: VB.NET
try
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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