Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 3rd, 2005, 12:51 PM
Registered User
 
Join Date: Aug 2004
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
 
Old January 3rd, 2005, 03:02 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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?





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 06:10 PM
OLEDB connection string variation Edward Stephen Classic ASP Databases 4 November 2nd, 2004 10:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.