473,696 Members | 1,609 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

connection string name

Hi,

When i add a connection string FpConnStr from application setting UI in VS
2008, it ends with sth. like:

<connectionStri ngs>
<clear />
<add name="CapiInter viewer.Properti es.Settings.FpC onnStr"
connectionStrin g="data source=PowerCap iData"
providerName="S ystem.Data.SQLi te" />
</connectionStrin gs>
Because this config is also shared by other class library/projects for the
same application/solution, I don't like the
"CapiInterviewe r.Properties.Se ttings" part VS 2008 added for me, is there
any way to avoid it without breaking code? For example, I also use VS 2008
data design to add a DataSet file (*.xsd), who will uses this connection
string.

Thanks a lot!
Ryan
Jun 27 '08 #1
3 2444


"Ryan Liu" <rl**@powercati .comwrote in message
news:ej******** ******@TK2MSFTN GP03.phx.gbl...
Hi,

When i add a connection string FpConnStr from application setting UI in
VS 2008, it ends with sth. like:

<connectionStri ngs>
<clear />
<add name="CapiInter viewer.Properti es.Settings.FpC onnStr"
connectionStrin g="data source=PowerCap iData"
providerName="S ystem.Data.SQLi te" />
</connectionStrin gs>
Because this config is also shared by other class library/projects for the
same application/solution, I don't like the
"CapiInterviewe r.Properties.Se ttings" part VS 2008 added for me, is there
any way to avoid it without breaking code? For example, I also use VS 2008
data design to add a DataSet file (*.xsd), who will uses this connection
string.

Thanks a lot!
Ryan
Just change the name value before using the connection. When asked to choose
a connection for a task later the new value will be used.
If the config file is shared across apps then you may want to consider
removing the clear element.

--

Joe Fawcett (MVP - XML)
http://joe.fawcett.name

Jun 27 '08 #2
Thanks Joe, but ...

"Joe Fawcett" <jo********@new sgroup.nospam>
??????:5B****** *************** *************@m icrosoft.com...
>

"Ryan Liu" <rl**@powercati .comwrote in message
news:ej******** ******@TK2MSFTN GP03.phx.gbl...
>Hi,

When i add a connection string FpConnStr from application setting UI in
VS 2008, it ends with sth. like:

<connectionStr ings>
<clear />
<add name="CapiInter viewer.Properti es.Settings.FpC onnStr"
connectionStri ng="data source=PowerCap iData"
providerName="S ystem.Data.SQLi te" />
</connectionStrin gs>
Because this config is also shared by other class library/projects for
the same application/solution, I don't like the
"CapiInterview er.Properties.S ettings" part VS 2008 added for me, is there
any way to avoid it without breaking code? For example, I also use VS
2008 data design to add a DataSet file (*.xsd), who will uses this
connection string.

Thanks a lot!
Ryan
Just change the name value before using the connection. When asked to
choose a connection for a task later the new value will be used.
If the config file is shared across apps then you may want to consider
removing the clear element.

If I just change name, then Design.setting. cs won't work. Seems it always
use short name to match "long" name in app.exe.config file.


--

Joe Fawcett (MVP - XML)
http://joe.fawcett.name

Jun 27 '08 #3
The reason that is being stored that way is you probably used the designer
to place a control on the form that needed a connection string, or you're
using the Settings section of the project to manipulate your app.config
file. If you don't want to have the name look like that, edit your
app.config file within your project manually, and set the connection strings
within your application when you need them.

You won't have that point and click ability to add designer controls to your
form, but i hate using those anyway. Also imo, DataSets tend to be overused
when working with databases. Keep an eye on how much memory your application
is using since that type stores all of the data in memory - depending on the
size of your table they can get very large and start to slow your
application down.

"Joe Fawcett" <jo********@new sgroup.nospamwr ote in message
news:5B******** *************** ***********@mic rosoft.com...
>

"Ryan Liu" <rl**@powercati .comwrote in message
news:ej******** ******@TK2MSFTN GP03.phx.gbl...
>Hi,

When i add a connection string FpConnStr from application setting UI in
VS 2008, it ends with sth. like:

<connectionStr ings>
<clear />
<add name="CapiInter viewer.Properti es.Settings.FpC onnStr"
connectionStri ng="data source=PowerCap iData"
providerName="S ystem.Data.SQLi te" />
</connectionStrin gs>
Because this config is also shared by other class library/projects for
the same application/solution, I don't like the
"CapiInterview er.Properties.S ettings" part VS 2008 added for me, is there
any way to avoid it without breaking code? For example, I also use VS
2008 data design to add a DataSet file (*.xsd), who will uses this
connection string.

Thanks a lot!
Ryan
Just change the name value before using the connection. When asked to
choose a connection for a task later the new value will be used.
If the config file is shared across apps then you may want to consider
removing the clear element.

--

Joe Fawcett (MVP - XML)
http://joe.fawcett.name
Jun 27 '08 #4

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

Similar topics

6
7270
by: Paul Robinson | last post by:
I am developing a website in ASP that connects to a Sybase database. However, when I try to open a connection to the database the page will not load. The script does not timeout, nor the connection. Further, the Sybase server shows no connection. Because the page is hanging I am unable, with my limited knowledge, to query the error collection. After many tries I will get an error page ...HTTP 403.9 Access forbidden: Too many users are...
0
4747
by: JWM | last post by:
I am trying to implement Oracle connection pooling for the following code, which was written by someone else. Here is my main question -- this java file creates code that is executed every hour, but once per week, the oracle server is brought down for backup. At that time, I get an error that looks like I have the wrong credentials for the database. For every subsequent attempt to run the hourly process, I am getting a broken pipe error,...
6
2154
by: H | last post by:
This is a question that has haunted me for quite some time. if you build a 4 tier database application where the 4th tier is the database server (MS SQL 2000), where do you build the connection string? The obvious answer is to hard code it into the middle layer and use a config file. The problem is the database application needs to be distributed to purchasing clients. Therefore, you do not know, at development, what the SQL
37
8951
by: sam44 | last post by:
Hi, At startup the user log on and chooses the name of a client from a dropdownlist, which then changes dynamically the connection string (the name of the client indicates which database to use). I then change dynamically the connection string by doing : My.Settings.Item("ConnectionString") = "some connection sring" The problem is that if another user loggs in and chooses another client, then obviously it changes the connection string...
1
6056
by: Sankalp | last post by:
Hi, I am using VB 2005. My application has many data bound controls. The connection is stored in the app.config file. I want the application to start with a default connection string and while during the runtime, the user can click on a button and change the connection string without exiting the application. I would really appreciate any sort of help.
0
789
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. Stack Trace at System.Net.Sockets.NetworkStream.Write(Byte buffer, Int32 offset, Int32
3
14051
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. Stack Trace at System.Net.Sockets.NetworkStream.Write(Byte buffer, Int32 offset, Int32
13
2838
by: Jennifer.Berube | last post by:
well I'm not sure how to go about making my SQL connection string... The code below is what I need to replace with my SQL connection...I just don't know if that code is for DSN or access... I don't want to use DSN just a connection string...help? function GetConnection() const DSN = "membershipdb" const UID = "webuser"
2
5391
by: Johnson | last post by:
I'm trying to fix a "sub optimal" situation with respect to connection string management. Your thoughtful responses will be appreciated. I just started with a new client who has a bunch of legacy ASP.NET applications that all manage connection strings in Web.config the same way, like this: This client has one Web.config file per application, and that one Web.config file is duplicated across all environments (i.e., dev machines, test,...
0
8594
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9005
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8873
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8847
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7697
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3027
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2310
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1989
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.