Posted on 2014-08-07
I cant get the SqlConnection.GetSchema to work with indexes.
Dim restrictions(3) As String
restrictions(2) = IdxName
dbTbl = conn.GetSchema("Indexes", restrictions)
If dbTbl.Rows.Count = 0 Then
IdxExist = False
IdxExist = True
I always get back 0 rows, even though there is an index. A similar routine works with Tables.
Also, the Microsoft webpage says Indexes schema has 6 restrictions. When I pass an array of 6 restrictions, I get an exception saying too many restrictions were passed. I want to pass the table name as one of the restrictions but it is restriction number 6.
What am I missing?