0
Dim NewConn As New OleDbConnection(strConn)      
        NewConn.Open()       
        Dim dlt1 As New OleDbCommand("DELETE * FROM Invoice ", NewConn)
        Dim dlt2 As New OleDbCommand("DELETE * FROM InvoiceDetail", NewConn)       
        Dim dlt3 As New OleDbCommand("DELETE * FROM Receiver ", NewConn)
        Dim dlt4 As New OleDbCommand("DELETE * FROM ReceiverDetail", NewConn)     

        dlt1.ExecuteNonQuery()
        dlt2.ExecuteNonQuery()
        dlt3.ExecuteNonQuery()
        dlt4.ExecuteNonQuery()

How to reset Primary Key table after delete?
Can primary Key reset to start from 1?

tx

2
Contributors
3
Replies
6
Views
5 Years
Discussion Span
Last Post by LearnVBnet
0

I get it

Dim cmdReset1 As New OleDbCommand
        cmdReset1.Connection = NewConn
        cmdReset1.CommandText = _
  String.Format( _
      "Alter Table ReceiverDetail Alter Column RecDetKey" _
  & " IDENTITY({0})", 1)
        cmdReset1.ExecuteNonQuery()

tx waqasaslammmeo
plz cek if need modified again.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.