Error: "more restrictions were provided" using GetSchema with ODBC connection to DSN
Posted on 2006-05-31
I want to get the schema information from a Microsoft SQL database, using an ODBC connection to the DSN for that database (this is a work constraint so it can't be changed). The connection is made without problem, the table information comes back fine, but when I try to add a restriction it gives me an error.
Here's the code:
public void FillMySchema(OdbcConnection pConn)
string restrictions = new string;
restrictions = "TABLE";
DataTable dtTables = pConn.GetSchema("Tables", restrictions);
The error is: "More restrictions were provided than the requested sceme ("Tables") supports.
What I am trying to do is filter out the tables of type "SYSTEM TABLE" and leave only type "TABLE". Am I using the syntax correctly?