SqlConnection.GetSchema Problems

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
        End If

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?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MikeBroderickAuthor Commented:
I forgot to specify the web page defining the number of restrictions:

MikeBroderickAuthor Commented:
I found the answer. The restrictions are described on this web page:


You have to specify the table name in the restrictions, then check the returned rows for the desired index name.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.