Problem

rana pranav posted at 03-Jul-08 06:37

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




Click here to sign in and reply. You could earn money via our $500 contest just for being helpful.
  Problem - rana pranav  03-Jul-08 6:37:25 AM
      solution to delete prob - Umapathy Kaliaperumal  03-Jul-08 6:46:49 AM
      Check this code and apply - santhosh kumar  03-Jul-08 6:59:01 AM
      This is also a sample code - try this too - santhosh kumar  03-Jul-08 7:01:26 AM
View Posts