How to reindex primary key table in OLEDB with VB.NET

117 Views Asked by At

I created my own index primary key with the .NET progran VB.NET. So how can my solution re-index the primary key and then load the database

Thanks

Already index

 Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load

            Using cn As New OleDbConnection(connectionString)
                Using cmd As New OleDbCommand("ALTER TABLE RPD ADD CONSTRAINT idxMyTable PRIMARY KEY (PNM,NOD)", cn)

                    cn.Open()
                    cmd.ExecuteNonQuery()

                End Using
            End Using

            LoadData()



        End Sub
1

There are 1 best solutions below

0
roy On BEST ANSWER

Here's a link!

                Using cn As New OleDbConnection(connectionString)
                    Using cmd As New OleDbCommand("DROP INDEX idxMyTable ON RPD;", cn)

                        cn.Open()
                        cmd.ExecuteNonQuery()

                    End Using
                End Using