473,383 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

include files

Hi all,

I used to use the include statement in classic asp to centralise my database
connection, is there a better way in asp.net, whats the norm?.

Thanks alot
Neil
Nov 17 '05 #1
5 3219
neil,

use web.config to store your db connection string...

HTH
"Neil Steventon" <ne************@qualtronyc.co.uk> wrote in message
news:vg************@corp.supernews.com...
Hi all,

I used to use the include statement in classic asp to centralise my database connection, is there a better way in asp.net, whats the norm?.

Thanks alot
Neil

Nov 17 '05 #2
MN
does asp.net support include files ?

MN

"Kerberoz" <de****@hotmail.com> wrote in message
news:uc**************@TK2MSFTNGP10.phx.gbl...
neil,

use web.config to store your db connection string...

HTH
"Neil Steventon" <ne************@qualtronyc.co.uk> wrote in message
news:vg************@corp.supernews.com...
Hi all,

I used to use the include statement in classic asp to centralise my

database
connection, is there a better way in asp.net, whats the norm?.

Thanks alot
Neil


Nov 17 '05 #3
MN
does asp.net support include files ?

MN

"Kerberoz" <de****@hotmail.com> wrote in message
news:uc**************@TK2MSFTNGP10.phx.gbl...
neil,

use web.config to store your db connection string...

HTH
"Neil Steventon" <ne************@qualtronyc.co.uk> wrote in message
news:vg************@corp.supernews.com...
Hi all,

I used to use the include statement in classic asp to centralise my

database
connection, is there a better way in asp.net, whats the norm?.

Thanks alot
Neil




Nov 17 '05 #4
ASP.Net has support for include files. However, the support is there mostly
for backwards-compatibility, and you should avoid using server-side
includes. The problem is that ASP is procedural in nature, and therefore, an
include file is processed in the position in the page script where it is
included. ASP.Net, however, is object-oriented, and your code is not
executed in the order in which it appears in the page. Objects are
instantiated, and their methods are called, and each object renders itself
in the page. This means that using an include file is not only NOT
object-oriented, but the results of including it can be not at all what you
might expect. Instead, try to stick with using object-oriented principles
and methods in your coding.

--
HTH,

Kevin Spencer
..Net Developer
Microsoft MVP
http://www.takempis.com
Big things are made up
of lots of little things

"MN" <ng******@yahoo.com> wrote in message
news:uU**************@tk2msftngp13.phx.gbl...
does asp.net support include files ?

MN

"Kerberoz" <de****@hotmail.com> wrote in message
news:uc**************@TK2MSFTNGP10.phx.gbl...
neil,

use web.config to store your db connection string...

HTH
"Neil Steventon" <ne************@qualtronyc.co.uk> wrote in message
news:vg************@corp.supernews.com...
Hi all,

I used to use the include statement in classic asp to centralise my

database
connection, is there a better way in asp.net, whats the norm?.

Thanks alot
Neil



Nov 17 '05 #5
u can do it as before in ASP.NET
"Neil Steventon" <ne************@qualtronyc.co.uk> дÈëÏûÏ¢ÐÂÎÅ
:vg************@corp.supernews.com...
Hi all,

I used to use the include statement in classic asp to centralise my database connection, is there a better way in asp.net, whats the norm?.

Thanks alot
Neil

Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Chad Scharf | last post by:
I have a legacy ASP application running on IIS 6.0 (Windows Server 2003 Web Edition) that is throwing an error when processesing a certain asp page that has about 200 or so include directives. ...
0
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
7
by: mescaline | last post by:
Hi, Suppose a_file.cpp contains a function a_function() Now to include it in main_file.cpp I just do #include "a_file.cpp" and I'm all set. i recently came across this seemingly roundabout...
6
by: atv | last post by:
Alright, i have some questions concerning include files en global variables.I hope someone is willing to answer these. 1).Why is it that if i define a global variable in a file, say main.c, and...
5
by: David Mathog | last post by:
One thing that can make porting C code from one platform to another miserable is #include. In particular, the need to either place the path to an included file within the #include statement or to...
1
by: Minh | last post by:
I've just installed VS.NET 2003 on my Athlon XP 1800+. However I couldn't get any project with STL includes to compile even if I create a new empty project (and added #include <string>). It gave me...
1
by: ya man | last post by:
when i use #include <iostream.h> in some files i get lots of error messages of the kind 'ambiguous symbol this is solved when i use #include <iostream why is that ? and can i use #include...
9
by: chat | last post by:
Hi, every body. I have 3 files like this: -------------------------------------------------------- file name : header.h #ifndef TEST_H #define TEST_H int a=1; double b=0.5;
2
by: key9 | last post by:
Hi all look at the organize tree main.c ------ #include lib_adapter.c main() { foo();
16
by: Chris Shearer Cooper | last post by:
In our Visual Studio 2005 application, we have several of our application's H files that are #included into stdafx.h. What is odd, is that when we change those application H files, VS2005...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.