Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2005

Tip: Looking for answers? Try searching our database.

Connection String Format

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jim McGivney - 22 Oct 2005 21:20 GMT
I am trying to place a connection string in the appSettings section of my
web.config.  I use C#.

I get an error message because of the "+" character.

<appSettings>
   <!-- DataBase Connection String -->
   <add key="connString" value="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" + "C:\Inetpub\wwwroot\Bobo\GfxDB.mdb" + ";User Id=admin;Password=;"
/>
</appSettings>
Any suggestions would be appreciated.  Thanks in advance for your help,

Jim
Kevin Spencer - 22 Oct 2005 23:21 GMT
Sure. You can only put string literals into a config file.

Signature

HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Ambiguity has a certain quality to it.

>I am trying to place a connection string in the appSettings section of my
>web.config.  I use C#.
[quoted text clipped - 10 lines]
>
> Jim
MasterGaurav - 23 Oct 2005 02:24 GMT
Configuration file is not a code. So, no "+" etc allowed.

Incase you are bothered about the connection string, you can lookup at:
http://www.connectionstring.com

--
Cheers,
Gaurav Vaish
http://mastergaurav.org
----------------------
zeyais@gmail.com - 23 Oct 2005 11:09 GMT
Treat this is as XML file. You might also want to check on special
characters that you might want to use. Use encoded characters.

In this case Gaurav already has given a valid anser.
Jim McGivney - 23 Oct 2005 19:51 GMT
My work-around:
I use three different appSettings keys, and then retrieved and combined them
in the C# code.
Thanks for yor help.
Jim

> Treat this is as XML file. You might also want to check on special
> characters that you might want to use. Use encoded characters.
>
> In this case Gaurav already has given a valid anser.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.