I need help with my web.config file

Discussion in 'ASP.NET 2.0' started by wisemx, Jan 1, 2007.

  1. It's a bit trickier to use Access Database connection strings in the web.config, somewhat easier to use the connection string there if you want and then thevirtual path to the data file in the data form.


    If you look at your connection string, comparing it to any examples you can find, you'll see it's not well formed and does not include the path at all.


    This may help however:


    http://aspalliance.com/631_Retrieving_Database_Schema_Information_using_the_OleDbSchemaGuid_Class


    Happy New Year,


    Mark Wisecarver
     
  2. Hello. Here's the code for my web.config file:

    <!-- Web.Config Configuration File -->

    <configuration>
    <connectionStrings>
    <add name="CustomerOrders" connectionString="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=|_database|customer_orders.mdb;"
    Name="System.Data.OleDb" />
    </connectionStrings>
    <system.web>
    <customErrors mode="Off"/>
    </system.web>
    </configuration>

    Here's the error that occurred when I loaded a page that I uploaded named 122906DataGridXml_cs.aspx:

    Parser Error Message: Unrecognized attribute 'Name'. Note that attribute names are case-sensitive.

    Source Error:

    Line 4: <connectionStrings>
    Line 5: <add name="CustomerOrders" connectionString="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=|_database|customer_orders.mdb;"
    Line 6: Name="System.Data.OleDb" />
    Line 7: </connectionStrings>
    Line 8: <system.web>


    Source File: E:\web\bkfwebdesi1\htdocs\web.config Line: 6


    Thanks for your help.
     

Share This Page