I have a button but it can save duplicate entries i don't know how to correctly put a if not exist operator pls help..
  cmd = New SqlCommand("INSERT INTO Students(Familyname,Firstname,Middlename,StudentID)VALUES('" & txtname.Text & "','" & txtfname.Text & "','" & txtmname.Text & "','" & txtid.Text & "')", cn)
    cn.Open()
    i = cmd.ExecuteNonQuery
    cn.Close()
    If txtname.Text <> "" Then
    ElseIf i > 0 Then
        MsgBox("Save Sucessfully!", MessageBoxIcon.Information, "Success")
        showrecord()
        clear()
    Else
        MsgBox("Save Failed!", MessageBoxIcon.Error, "Error")
    End If
 
     
    