Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET 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 January 6th, 2005, 03:22 PM
Authorized User
 
Join Date: Jan 2005
Location: havana, , Cuba.
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default setting connection string in the web.config

hi, i'm having troubles in placin' a sql connection string in an appsettings tag in the web.config file.
the problem raise when i set the value attribute in the add key tag.
my connection string includes several "s and i used the token /u2022
where the "s must be placed.
example1:

<appSettings>
<add key="sqlconnString" value="workstation id='\u0022'INFO-7834'\u0022'; packet size=4096;integrated security=SSPI;data source='\u0022'INFO-7834'\u0022';persist security info=True;initial catalog=dbapps">
</appSettings>

i 've also tested:

example 2:

<appSettings>
<add key="sqlconnString" value="workstation id=\"INFO-7834\";packet size=4096;integrated security=SSPI;data source=\"INFO-7834\";persist security info=True;initial catalog=dbapps">
</appSettings>

and...worse for the compiler!!!

for the first snippet of code i got the following exception "Format of the initialization string does not conform to specification starting at index 23" where 23 is the position that is preceded by the first '\u0022' in the first example.
waiting for your help.
Reply With Quote
  #2 (permalink)  
Old January 6th, 2005, 04:13 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

You don't need all the quotes. The semi-colon is used as a separator:

<add key="sqlconnString" value="integrated security=SSPI;data source=INFO-7834;persist security info=True;initial catalog=dbapps">

should do the trick.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #3 (permalink)  
Old January 6th, 2005, 04:33 PM
Authorized User
 
Join Date: Jan 2005
Location: havana, , Cuba.
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks a lot imar, it worked perfectly!!!good luck!!!
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
Connection String setting at runtime TwoTrees BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 3 July 2nd, 2010 11:41 AM
Setting of web config file epkgupta General .NET 0 July 9th, 2008 09:32 AM
connection string issues, web.config file issues kaliaparijat ASP.NET 2.0 Professional 1 June 12th, 2008 08:07 AM
Setting the Locale within Web.Config rit01 ASP.NET 2.0 Basics 1 March 2nd, 2006 11:06 AM
Variable Path in web.Config Connection String? ElPato General .NET 4 June 21st, 2004 05:44 PM



All times are GMT -4. The time now is 07:46 AM.


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