When I use
SqlConnection.GetSchema(\"Tables\");
it returns all the tables AND views for the target database.
Is there any way to j
According to this article, the returned data table has a column table_type
, which tells you whether it's a VIEW
or a BASE TABLE
.
Use that column to filter out the views on your C# end.
Here is the complete syntax
DataTable table = connection.GetSchema("Tables", new string[] { null, null, null, "BASE TABLE" });