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
Solved

Connection strings in ASP.net woith Access

Posted on 2011-03-22
3
445 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:murbro
  • 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 500 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:murbro
ID: 35193436
Thanks very much
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

829 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