I want to stick this
Dim cmd As OleDbCommand = New OleDbCommand("SELECT * FROM 0 WHERE Id = 1", con)
Dim reader As OleDbDataReader = cmd.ExecuteReader()
If Not reader.HasRows Then
MsgBox("Data does not exist")
Else
MsgBox("Data Exists")
End If
and this
If Inc <> -1 Then
Dim cb As New OleDb.OleDbCommandBuilder(da)
Dim dsNewRow As DataRow
da.Fill(ds, "0")dsNewRow = ds.Tables("0").NewRow()
dsNewRow.Item("Field1") = TextBox2.Text
ds.Tables("0").Rows.Add(dsNewRow)
da.Update(ds, "0")
MsgBox("New Record added to the Database")
con.Close()
MsgBox("Database is now Closed")
Into a If Then Statement that doesnt allow the second code to execute if the Data Exists
And to allow code to execute if data doesnt exist