The solution below is with the assumption that the "ID" column is not auto incremented value.
1. The user enters the value of the 'ID' from the front end.
2. Check if that value exists in your dataset.
3. If it does not exists in your dataset then insert the value in the database.
4. If that value exists in the dataset then display a message.
Below I will just show you how to change the insert part
Dim result() As DataRow = myds.Tables(0).select("ID = '"+ txtid.Text +"'")
If (result.Length == 0) Then
mycmd.Connection = mycon
mycmd.CommandText = "insert into `tbluseradmin`(`ID`,`Name`,`MiddleName`,`LastName`,`Gender`,`Subject`,`Position`)values('" & txtid.Text & "','" & txtname.Text & "','" & txtmn.Text & "','" & txtln.Text & "','" & cbogender.Text & "','" & cbosub.Text & "','" & cbopos.Text & "')"
mycmd.ExecuteNonQuery()
mycon.Close()
My.Computer.FileSystem.CopyFile(ofd.FileName, Application.StartupPath & "\images\" & txtid.Text & ".jpg")
MsgBox("Record Save", MsgBoxStyle.Information, "")
Else
MsgBox("ID already exists")
End
Hope the above code helps.