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 7632941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:45:16+00:00 2026-05-31T06:45:16+00:00

I am using Visual Studio 2008. I have created a Winforms application, and I

  • 0

I am using Visual Studio 2008.

I have created a Winforms application, and I am trying to extract the table name from a SQL statement.

con = new SqlConnection(connString);
String queryString = "Select CUSTOMER_NAME from CUSTOMER_DETAIL";

Is there any function to do so?

Please help me out.

  • 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-05-31T06:45:17+00:00Added an answer on May 31, 2026 at 6:45 am

    It’s good that you have mentioned Java’s ResultSetMetaData. Quoting that link:

    public interface ResultSetMetaData

    An object that can be used to get information about the types and
    properties of the columns in a ResultSet object.

    As for C#, you can get the same information using the DataColumn Class.

    DataType Property of DataColumn class can be used to get (and to set) the type of data stored in column, AllowDBNull can be used to get (and set) the value that indicates whether null values are allowed in this column, etc… To get the full list of DataColumn properties follow the link I have posted above.

    Sample code (gets column datatype):

    SqlConnection con = new SqlConnection(connString);
    String queryString = "Select CUSTOMER_NAME from CUSTOMER_DETAIL";
    SqlCommand cmd = new SqlCommand(queryString, con);
    DataTable myTable = new DataTable();
    myTable.Load(cmd.ExecuteReader());
    DataColumn column = myTable.Columns[0]; // zero based index of column, alternatively use column name
    string typeOfColumn = column.DataType.Name; // or column.DataType.FullName to get the fully qualified name of the System.Type
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Visual Studio 2008 and have created a setup project for my application.
I have created a setup project using Visual Studio 2008. After the application is
I have a WinForms application built using Visual Studio 2008. I added a Setup
I have a solution created using visual studio 2008 named, Solution , and i
Using Visual Studio 2008, c#, .net 2.0. I have a Windows Forms client application
Let's create WinForms Application (I have Visual Studio 2008 running on Windows Vista, but
I am new to LINQ. I am using Visual Studio 2008 and have created
I have a standard MSI being created using Visual Studio 2008. Is there any
I have created a custom control using VB.NET in Visual Studio 2008 that gives
I'm using Visual Studio 2008 SP1 and trying to debug a website created in

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.