Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8779759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:52:42+00:00 2026-06-13T19:52:42+00:00

When I use SqlConnection.GetSchema(Tables); it returns all the tables AND views for the target

  • 0

When I use

SqlConnection.GetSchema("Tables");

it returns all the tables AND views for the target database.

Is there any way to just return tables? All the research I have done indicates I am doing this correctly yet it always returns the views like they are tables. I have dug down into the DataTable in debug and I can’t even find a difference. The data types are reported the same… As far as I can tell, it can’t differentiate between a view and a table. (It does make sense in a way since a view for all intents and purposes IS a table.)

I am using the Northwind database for testing.

I am writing the application in C#.

Here is the code that I am running to get the schema info. Pretty simple.

SQLCon.Open();
DataTable tables = SQLCon.GetSchema("Tables");
SQLCon.Close();

I would very much like to use the getschema method and not have to query the database in another fashion… if at all possible.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T19:52:44+00:00Added an answer on June 13, 2026 at 7:52 pm

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can use GetHashCode() to identify an object but is there any way to
I use the ADO.Net SqlConnection, SqlCommand and SqlDataReader for all of my database interaction
Can you use 2 'using' statements like: using (SqlConnection ..) { using(SqlDataReader reader =
I have a Web Service that requires an SqlConnection. There are 5 web methods
I usually use code like this: using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings[MyConn].ConnectionString)) { var
I can use !do to dump the SqlConnection instance but not sure how to
Currently I use a lot of the ado.net classes (SqlConnection, SqlCommand, SqlDataAdapter etc..) to
SqlConnection conn1 = new SqlConnection(Server=ILLUMINATI; + Database=DB;Integrated Security= true); SqlCommand COMM = new SqlCommand(select
Would it be wise to Use a Dll to access a database When a
I know that when I use ado.net, I can create database or table at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.