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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:48:45+00:00 2026-06-14T19:48:45+00:00

I was wonder if I can exclude static property when I’m using GetProperties() to

  • 0

I was wonder if I can exclude static property when I’m using GetProperties() to extract all the property for a specific class. I’m aware of using BindingFlags for this to filter properties what I need but what I really want is that I want to exclude static properties. I try to use something like this:

typeof(<class>).GetProperties(!BindingFlags.Static);

but I don’t think it works, because VS throw me some syntax error. Here is what inside my class with properties.

public class HospitalUploadDtl : Base.Tables
        {
            public HospitalUploadDtl() { }
            public HospitalUploadDtl(SqlDataReader reader)
            {
                ReadReader(reader);
            }
            #region Properties
            public long BatchDtlId { get; set; }
            public long BatchNumber { get; set; }
            public string HospitalCode { get; set; }
            public string HospitalName { get; set; }
            public string Address { get; set; }
            public string City { get; set; }
            public string Country { get; set; }
            public string ContractPerson { get; set; }
            public string ContactNo { get; set; }
            public string Email { get; set; }
            public bool isAccredited { get; set; }
            public bool isClinic { get; set; }
            public string FaxNo { get; set; }
            public string TypeofFacility { get; set; }
            public string Category { get; set; }
            public string Specialty { get; set; }
            public string ProviderName { get; set; }
            public bool CashlessInPatient { get; set; }
            public bool CashlessOutPatient { get; set; }
            #endregion

            public static dcHospitalUploadDtl dataCtrl;
            public static dcHospitalUploadDtl DataCtrl
            {
                get
                {
                    if (dataCtrl == null)
                        dataCtrl = new dcHospitalUploadDtl();
                    return dataCtrl;
                }
            }
        }

for this scenario I want to exclude “DataCtrl” property when I call for GetProperties(). Thanks for the response. 🙂

  • 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-14T19:48:46+00:00Added an answer on June 14, 2026 at 7:48 pm

    I think you’re looking for BindingFlags.Instance | BindingFlags.Public (if you only include Instance, no properties will be found since neither Public nor NonPublic are specified).

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

Sidebar

Related Questions

I wonder if I can execute some programs for different cmd's using .bat file.
I wonder why I can't read the JSON Object like this : { 1:{bulan:Januari,tahun:2012,tagihan:205000,status:Lunas},
I wonder why other languages do not support this feature. What I can understand
this question is uncategorized.. i guess. I wonder can i convert every recorded voice
I wonder how other people handle this issue, and can't seem to find a
Im using Jquery Post in my code, and Im wonder how can I call
I wonder how can I code this: //if there is any ajax request $("#loader").css("display","block");
I wonder how can I get the list of MySQL databases in PHP using
I wonder how can i remove all string part after #. For example if
I wonder how can I remove this grey border from buttons in dialogues? For

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.