Friends,
In vb.net2003 I have written following coding, it’s working perfectly. it gives no error but problem is when I click on delete button and click on yes button data is deleted it self but when I rebuilt the program it gives data that I have already deleted what I have to do for that just give me a code for that if I have done mistake
Dim strMessage As String
Dim intDialogResult As DialogResult
Dim strQry As String
Try
strMessage = "You Are About to Delete Current Record ..."
strMessage = strMessage & vbCrLf & "Are You Sure?"
intDialogResult = MessageBox.Show(strMessage, "Deleting...", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2)
If intDialogResult = DialogResult.Yes Then
If recCount Then
If curPos <= recCount - 1 Then
strQry = "Delete from New_Master where ISBN =" & "' txtISBN.Text'"
dt.Rows(curPos).Delete()
recCount = dt.Rows.Count - 1
dv.Table = dt
PerformActionQry(strQry)
If curPos + 1 < recCount Then
curPos += 1
Show_CurrentRecord(curPos)
Else
curPos = 0
Show_CurrentRecord(curPos)
End If
End If
Else
Call Clear_ALL()
End If
End If
Catch ex As Exception
MessageBox.Show("Error In Delete" & vbCrLf & ex.ToString, "Demo", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
Regards, Pranav |