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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:41:13+00:00 2026-06-12T21:41:13+00:00

I have a helper class in my root AppCode folder that saves me time

  • 0

I have a helper class in my root AppCode folder that saves me time and coding executing database related tasks

and i am looking for a way to have all tables and columns names into the intelliSense

so for example

public static class GetTableData
{
    //base method
    static int ExecSQLint(string TblintSQL)
    {
        int value;
        SqlConnection myConn = new SqlConnection("server=(local);Initial Catalog=dbName;Integrated Security=True");
        SqlCommand TblintCMD = new SqlCommand(TblintSQL, myConn);

        try
        {
            myConn.Open();
            value = Convert.ToInt32(TblintCMD.ExecuteScalar());
        }
        finally
        {
            myConn.Close();
        }

        return value;
    }

    //return a Database value as int 
    public static int AsInt(string FieldToSearch, string tblName, string WhereClause, string FLdValue)
    {
        string TblintSQL = "SELECT " + FieldToSearch + " FROM " + tblName + " WHERE " + WhereClause + " ='" + FLdValue + "'";
        return ExecSQLint(TblintSQL);
    }
}

so if i need a customer id(int) from a table for example

some [tblCustomers] i have a column named custID and name

i will retrive customer id via following Code

int custId = GetTableData.AsInt("custID", "tblCustomers", "name", "warren");

I would like to get available Columns and table names into Visual studio so i will not have to use
strings as used in example above
what would be the simplest way to achieve that ?,

is it by generating a code that will generate a class with const strings

or is there a utility I don’t know about inside the Visual Studio ? (I’m currently using 2010 Pro)

  • 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-12T21:41:14+00:00Added an answer on June 12, 2026 at 9:41 pm

    You can use Entity Framework to build classes from your tables, views and stored procedures.

    http://msdn.microsoft.com/en-us/library/bb386876(v=vs.100).aspx

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

Sidebar

Related Questions

I have a helper class that I want to display a UIAlertView then will
I have a helper class that should only ever run in a background thread.
I have a helper class that is passed an array of values that is
I currently have a helper class that I am using to obfuscate a static
I have a REST service and I want to have a helper class that
I have a helper class that implements ITypedList, to provide objects for databinding against
I have a helper class pulling a string from an XML file. That string
I have a helper class that is just a bunch of static methods and
I have a helper class designed to get data from Core Data and pass
I have a JSON helper class. I have been trying to to display a

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.