Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles addbtn.Click If myconn.State = ConnectionState.Open Then myconn.Close() End If myconn.Open() Dim i As Integer = mycom.ExecuteNonQuery() Dim Q As String ''------------------------------------------------------------------------------------- ''------------------------------------------------------------------------------------- Q = "INSERT INTO tblelogin(Username,name,Password,Accounttype) VALUES('" Q = Q + txtuname.Text + "','" + txtname.Text + "','" + txtpass.Text + "','" + accountbox.Text + "')" If txtpass.Text <> txtconfirm.Text Then MsgBox("password mismatch. please enter again.") txtpass.Text = "" txtconfirm.Text = "" End If If txtuname.Text = "" Or _ txtpass.Text = "" Or _ txtname.Text = "" Or _ txtconfirm.Text = "" Or _ accountbox.Text = "" Then MsgBox("input data on the field.") Exit Sub Else mycom.CommandText = Q i = mycom.ExecuteNonQuery() If (i > 0) Then MessageBox.Show("Record is Successfully Inserted") Else MessageBox.Show("Record is not Inserted") myconn.Close() End If End If
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)