Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Connection strings in ASP.net woith Access

Posted on 2011-03-22
3
Medium Priority
?
450 Views
Last Modified: 2012-06-21
Hi
In my ASP.net project I have the following connection string in my Web.config file:
 <add name="WhatEverNameYouWant" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Database\GC.accdb;"  />

I then use the following VB code to update the connection
        Dim cs As String = ConfigurationManager.ConnectionStrings("WhatEverNameYouWant").ConnectionString
        cs = cs.Replace("Database\GC.accdb", Server.MapPath("Database\GC.accdb"))

This all works fine for the \Database\GC.accb online but where should I put my Access database for this to work when debbugging too. In which folder of my project
0
Comment
Question by:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 35193325
Put it in the APP_Data folder you can then use the following connection string:

<add name="WhatEverNameYouWant" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=[DataDirectory]GC.accdb;"  />

0
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 2000 total points
ID: 35193345
Sorry mistype :
<add name="WhatEverNameYouWant" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|GC.accdb;"  />

0
 

Author Closing Comment

by:Murray Brown
ID: 35193436
Thanks very much
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question