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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:06:14+00:00 2026-05-30T23:06:14+00:00

Here’s a question the popped in my mind: Is it possible to show only

  • 0

Here’s a question the popped in my mind: Is it possible to show only property(ies) based on what the user has passed parameter in the contructor? To make this question more clear, I’ll illustrate a simple class with some properties.

Public Class SampleClass

    Dim _ForA as string
    Dim _ForB as string

    Public ReadOnly Property PropertyA as String
        Get
            return _ForA
        End Get
    End Property

    Public ReadOnly Property PropertyB as String
        Get
            return _ForB
        End Get
    End Property

    Public Sub New(SelectProp as string)

    End Sub

End Class

If the user will pass A (string) in the constructor only PropertyA is shown and if B is passed then PropertyB will only be shown. Is it possible in .Net?

Here’s another thing. I found this declaration in some code in the internet. Can you explain what is happening in the declaration?

Imports System.Data

#If DBType = "OLEDB" THEN
Imports System.Data.OleDB
#End IF

#If DBType = "SQLClient" THEN
Imports System.Data.SqlClient
#End IF

Thanks.

  • 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-30T23:06:15+00:00Added an answer on May 30, 2026 at 11:06 pm

    The name is Conditional Compilation
    You can use conditional compilation to select particular sections of code to compile while excluding other sections. For example, you may want to write debugging statements that compare the speed of different approaches to the same programming task, or you may want to localize an application for multiple languages. Conditional compilation statements are designed to run during compile time, not at run time.

    You declare a conditional compiler constant in code with the #Const directive, and you denote blocks of code to be conditionally compiled with the #If…Then…#Else directive. For example, to create French and German language versions of the same application from the same source code, you embed platform-specific code segments in #If…Then statements using the predefined constants FrenchVersion and GermanVersion. The following example demonstrates how

    #If FrenchVersion Then
       ' <code specific to the French language version>.
    #ElseIf GermanVersion Then
       ' <code specific to the German language version>.
    #Else
       ' <code specific to other versions>.
    #End If
    

    Read this
    Conditional Compilation

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

Sidebar

Related Questions

Here are some facts about my app followed by a question My app has
Here is the code: create table `team`.`User`( `UserID` bigint NOT NULL AUTO_INCREMENT , `Username`
Here are the tables I have: Table A which has entries with item and
Here's the code I have. It works. The only problem is that the first
Here is a simplification of my database: Table: Property Fields: ID, Address Table: Quote
Here a simple question : What do you think of code which use try
Here's the view: @if (stream.StreamSourceId == 1) { <img class=source src=@Url.Content(~/Public/assets/images/own3dlogo.png) alt= /> }
Here's my code in the <head></head> : <link rel=stylesheet href=http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css /> <script type=text/javascript src=http://code.jquery.com/jquery-1.7.1.min.js></script>
Here is the code in a function I'm trying to revise. This example works
Here is my work environment: Eclipse Juno as IDE with maven2 plugin on it

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.