Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 26th, 2006, 07:37 PM
Authorized User
 
Join Date: Dec 2005
Location: San Nicolas, Buenos Aires, Argentina.
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
Reply With Quote
  #2 (permalink)  
Old February 26th, 2006, 07:42 PM
Wrox Technical Editor
 
Join Date: Dec 2005
Location: , , Canada.
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
Reply With Quote
  #3 (permalink)  
Old February 26th, 2006, 07:44 PM
Wrox Technical Editor
 
Join Date: Dec 2005
Location: , , Canada.
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
Reply With Quote
  #4 (permalink)  
Old February 26th, 2006, 07:54 PM
Authorized User
 
Join Date: Dec 2005
Location: San Nicolas, Buenos Aires, Argentina.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 11:14 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.