Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.††If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .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 Display Modes
  #1 (permalink)  
Old January 3rd, 2005, 11:51 AM
Registered User
 
Join Date: Aug 2004
Location: Trivandrum, Kerala, India.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default OleDb Connection string

Hai,
  How can we set the OleDb Connection string (using Server.MapPath)
dynamically in a web.config file.
  <appSettings>

  </appSettings>
Hoping to hear from u soon...

Thanking You

BIMAL
Reply With Quote
  #2 (permalink)  
Old January 3rd, 2005, 02:02 PM
Imar's Avatar
Wrox Author
Points: 65,660, Level: 100
Points: 65,660, Level: 100 Points: 65,660, Level: 100 Points: 65,660, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 15,962
Thanks: 64
Thanked 1,349 Times in 1,329 Posts
Default

Hi there,

You can't do this directly. However, I have implemented this in the past by using two separate config settings. One for the database folder name, and one for the rest.

Then at run-time, retrieve the foldername, use Server.MapPath to translate the path into a physical path, and append it to the rest of the connection string.

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: North West Three by Fatboy Slim (Track 8 from the album: Palookaville) What's This?
Reply With Quote
Reply


Thread Tools
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
webpart using sonofsmartpart and OLedb Connection aymane SharePoint Development 0 June 20th, 2006 09:59 AM
Missing parameter in Jet OLEDB connection OldCoder ASP.NET 1.0 and 1.1 Professional 2 April 21st, 2006 11:29 PM
Deploying CR 8.5 using (DSN less) OLEDB Connection ashu_from_india Pro VB 6 0 June 29th, 2005 04:12 AM
OLEDB Connection Dialog Kep C# 4 December 15th, 2004 05:10 PM
OLEDB connection string variation Edward Stephen Classic ASP Databases 4 November 2nd, 2004 09:26 AM



All times are GMT -4. The time now is 02:54 AM.


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