Wrox Programmer Forums
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 26th, 2006, 07:37 PM
Authorized User
 
Join Date: Dec 2005
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to arielote Send a message via MSN to arielote Send a message via Yahoo to arielote
Default #include

Hi:
Does somebody know if exists in C# something similar to #include "xxx.h" in C languaje.
I am developing a DB frontend application, and I would like to insert into a .H file some connection string, in order to #define a server just to developing and when the App is released, I would like just to change #define statement.
.H file will be like:

#define CMP1 // Just for developing
// #define CMP2 // To test in some network
// #define CMP3 // Release version of APP

#if CMP1
    #define STRCONNECTIONSTRING "user id=sa;password=xxx1;initial catalog=ppp_db;data source=192.168.0.2;Connect Timeout=30".Trim();
#elif CMP2
    #define STRCONNECTIONSTRING "user id=xxx2;password=xxx2;initial catalog=mmm_db;data source=dbsvr2;Connect Timeout=30".Trim();
#else
    #define STRCONNECTIONSTRING "user id=xxx3;password=xxx3;initial catalog=ooo_db;data source=dbsvr3;Connect Timeout=30".Trim();
#endif

If somebody has other idea, I will be keen to ear that.

Regars

Ariel





---
Ariel Folonier
San Nicolas
Argentina
__________________
---
Ariel Folonier
San Nicolas
Argentina
 
Old February 26th, 2006, 07:42 PM
Wrox Technical Editor
 
Join Date: Dec 2005
Posts: 271
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is a list of C# Preprocessor Directives:
http://msdn.microsoft.com/library/de...Directives.asp

- A.Kahtava
 
Old February 26th, 2006, 07:44 PM
Wrox Technical Editor
 
Join Date: Dec 2005
Posts: 271
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There isn't an equivalent to the #include that I know of, The closest thing would be the #using tag.

Here's a little trick for Reusing C# Source Code Across Multiple Assemblies: http://weblogs.asp.net/savanness/arc.../22/10417.aspx

- A.Kahtava
 
Old February 26th, 2006, 07:54 PM
Authorized User
 
Join Date: Dec 2005
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to arielote Send a message via MSN to arielote Send a message via Yahoo to arielote
Default

Thank you Adam!!!!


Ariel

---
Ariel Folonier
San Nicolas
Argentina





Similar Threads
Thread Thread Starter Forum Replies Last Post
c #include vicoldan Need help with your homework? 0 December 3rd, 2007 06:15 AM
Include in C# su C# 2 December 15th, 2006 04:59 AM
USING INCLUDE FIEL jhan316 Beginning PHP 1 August 8th, 2006 08:01 AM
difference between include file & include virtual crmpicco Classic ASP Basics 2 January 23rd, 2006 11:50 AM
xsl:include within include chuck123ie XSLT 1 January 5th, 2006 11:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.