how to insert the values of checkbox and radiobuttons in the sql databse using vb.net???
we are getting problem in inserting and don't know what to do................
like i have one form with two text boxes named username and password and one label say gender....which has two checkboxes male and female and another label with two radiobuttons....yes and no....
on the submit button i want to insert the values into database.....made in
SQL server management studio 2008 and em using vb.net 2008
Imports System.Data.SqlClient
Public Class Form1
Dim con As New SqlConnection
Dim com As New SqlCommand
Dim d As New SqlDataAdapter
Dim da As Integer
Dim rbtn As String
Dim a, b As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
con = New SqlConnection("server=abc-pc\sqlexpress;database=abc;trusted_connection=yes")
con.Open()
com = New SqlCommand("INSERT INTO user (username,password,bonus,others) VALUES ('" + TextBox1.Text + "','" + TextBox2.Text + "','" + a + "','" + b + "')", con)
com.ExecuteNonQuery()
MessageBox.Show("saved",da)
con.Close()
End Sub
em getting error at com.executenonquery