Home All Groups Group Topic Archive Search About

Trouble with DbConnection.GetSchema()

Author
28 Mar 2006 3:11 PM
Sneil
Hello,

I trying to get some schema info with help of string of code:
_conn.GetSchema("Tables", sa)
where _conn is type of DbConnection. So - sa must be string[] type. If
I define sa like this:
            string[] sa = new string[3];
            sa[0] = "master";
            sa[1] = null;
            sa[2] = "users";
all fine, I get row "master        dbo        users        BASE TABLE". This was SYSTEM
database. Now want the same but for my own MSSQL database with name
"TestBase". Such database definitely exist on the same server and
definitely has table "MyTbl2". So I re-define sa:
            string[] sa = new string[3];
            sa[0] = "TestBase";
            sa[1] = null;
            sa[2] = "MyTbl2";
and get... nothing. Just empty DataTable? :( What's wrong?

AddThis Social Bookmark Button