Private Sub Bt_save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bt_save.Click
Dim objConn As New SqlConnection
Dim objCmd As New SqlCommand
Dim strConnString, strSQL As String
Dim sb As New StringBuilder
strConnString = "Data Source=NOEY-PC\SA;Initial Catalog=Project;Persist Security Info=True;User ID=sa;Password=powergurn"
strSQL = "INSERT INTO Member (Mem_Ques,Mem_Ans)" & " VALUE " & " ('" & Me.ComboBox1.Text & "'" & Me.txtAns.Text & "')"
objConn.ConnectionString = strConnString
objConn.Open()
With objCmd
.Connection = objConn
.CommandText = strSQL
.CommandType = CommandType.Text
End With
If ComboBox1.Text <> "" Then
sb.Remove(0, sb.Length)
sb.Append("Insert into Member (Mem_Ques,Mem_Ans)")
sb.Append(" Values ('" & ComboBox1.Text & "')")
strSQL = sb.ToString()