您好,代码没有错误,但是当您检查数据库时,没有添加任何内容
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Create_btn.Click
Call getConnect()
If New_Username.Text = "" And New_Password.Text = "" And New_Pass_Code.Text = "" Then
MsgBox("check the empty textbox or wrong Admin Password", MsgBoxStyle.Critical, "needed")
Else
con.Open()
sql = "INSERT into Accounts (Username, Password, Pass_Code) values('" _
& New_Username.Text & "','" _
& New_Password.Text & "' , '" _
& New_Pass_Code.Text & "')"
Dim sqlcomd As New SqlClient.SqlCommand
sqlcomd.CommandText = sql
sqlcomd.Connection = con
sql = sqlcomd.ExecuteNonQuery
MsgBox("data saved")
con.Close()
End If