ASP.NET Connection String


I built an ASP.NET C# pages and I used MS Access Database.  Everything worked just fine.
After I published it on the entrant, there is not connection to the database.

I added a connection string to the web.confg, but I forgot how to connect it the the Gridviews I have on the pages.

Any recommendations?

Thank you,
Who is Participating?
oxyooConnect With a Mentor Commented:
Without seeing you code it's hard to tell... but I would take a look at the firewall and make sure it is not blocking access to the database. Also, is the database and website on the same machine or on two different machines?
RD11Author Commented:
On the same server.

Here is the Web.confi before and after I published it:

<?xml version="1.0"?>
		<compilation debug="true">
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
		<authentication mode="Windows"/>
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.

Open in new window

Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
Access has to be opened in read/write mode.  That is frequently not allowed on web hosting unless you set it up in special directories with special access permissions.
RD11Author Commented:
I am looking for the connection between the connection string and the GridView on all the pages.
brutaldevConnect With a Mentor Commented:
If you've just lost the conenction string in your config, just add it again:
      connectionString="Provider =Microsoft.Jet.OLEDB.4.0; Data Source =|DataDirectory|\myDatabase.mdb; User Id =admin; Password =;"

Open in new window

Example of possible strings to use with your Access database:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.