473,320 Members | 2,147 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,320 software developers and data experts.

Can we have Common Connection String in ASP.NET

144 100+
Hai Friends,

I have a Question , Actually in My Project I am Having Nearly more than 50 Webforms , My Backend is Sql server 2000 , in the future i want to change Oracle...Then I have to Change Connection String for .... in more than 50 webforms it really irritating....

So there is any option to put this ConnectionString in commonPlace and call whenever Necessary.....like a function in C , So that I can Change Easily.... if You have any idea Pl Reply me.......

i have the following code.....

dim cn As New System.Data.sqlclient.SqlConnection

cn.ConnectionString = "Persist Security Info=False;User ID=sa;Initial Catalog=master;password=david;"

cn.Open()



Davidson

2 March 2008...
Mar 2 '08 #1
1 828
kenobewan
4,871 Expert 4TB
Place your connection strings in the web.config and think about using classes. HTH.
Mar 3 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

17
by: AMC | last post by:
Hi, I'm using an include file to store the connection string to a database. Whenever I try to reference that string to open a connection in the page that includes the file I get the error 'empy...
4
by: Klemens | last post by:
One database tells on every connect statement: SQL1092N "" does not have the authority to perform the requested command. Another database at the same instance works fine. One day before the...
1
by: Burton Wilkins | last post by:
Dear Brandon: You sent me some advice before as to how get the DataLink working, but I haven't been able to get your solution to compile: You sent me this: >Hi Burton, I was able to get the...
2
by: Alex Smith | last post by:
Hi Friends I want to make common connection string for database. I can not use Web config file, so please give idea excluding web.config file. Thanks. Alex
3
by: Pete via DotNetMonster.com | last post by:
Hi, I've created a class that contains a common function. When I try to invoke the function or method, I get the error: BC30451: Name 'dataClass' is not declared. The class file dataClass.vb...
3
by: fniles | last post by:
In the Windows application (using VB.NET 2005) I use connection pooling like the following: In the main form load I open a connection using a connection string that I stored in a global variable...
3
by: ninjamonkey | last post by:
Hi all, I've developed a mobile application for windows mobile 5.0 that has been in use for a while (1 year and a couple of months). It was developed in visual studios 2005 with a back-end sql...
7
by: Mark B | last post by:
How do I have a SiteMap based on the output of a stored procedure? (I want to pass a @LanguageCode parameter to it so it will display the top Menu in the appropriate language).
0
by: Robert Avery | last post by:
In VBA/VB6, I had a class (incomplete sample below) that watched and displayed for the user all connection events, so that I could easily see what SQL was taking a long time, and when it freezes, I...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.