database connection using Visual Studio 2005 web.config file

Discussion in 'ASP.NET 2.0' started by susanshemin, Jan 22, 2006.

  1. [​IMG]DiscountASP shows how to connect to the SQL Server 2005 database by using a code connection. Visual Studio however uses the connection string in the web.config file, and their data controls are tied into using the SQLDataSource which pulls from the connection. I've tried copying the connection string from the supplied C# code in the Control Panel database page (see below), but the server won't accept the code.

    Has anyone done this already and can help me through it?


    Server Error in '/' Application.


    Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: Unrecognized configuration section 'connectionStrings'

    Source Error:





    Code:
    Line 10: <configuration>
    Line 11:   <appSettings/>
    Line 12:   <connectionStrings>
    Line 13:     <add name="ConnectionString" connectionString="Data Source=sql2k501;Initial Catalog=SQL2005_211713_westchester;User ID=SQL2005_211713_westchester_user;Password=******"/>
    Line 14:   </connectionStrings>
    Source File: E:\web\westchester\htdocs\web.config Line: 12



    Version Information:Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300
     
  2. I've seen this error when asp.net 2.0 framework is not installed on the site. Double check you are not on framework 1.1


    Joel Thoms

    DiscountASP.NET
    http://www.DiscountASP.NET
     

Share This Page