configuring aspnet to use SQL2000

Discussion in 'ASP.NET 2.0' started by bigmike40, Mar 15, 2007.

  1. Hi Guys
    I have tryed to used this article to run SQL 2000 and once i change the connection string tothe new string that shown in this aritcle i get error in my web.config vwd05 can someone tell why
    http://kb.discountasp.net/article.aspx?id=10413
     
  2. Can you post the error message,so that we know whats causing it and resolve it accordingly.

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. This my web.con file the new connection string
    this the ERROR PARSING APPLICATIONCONFIGURATION FILE LINE 15
    and theseas a line show an errorDB-SERVER AND DB- PASSWORD, </connectionstring>






    <!--


    Note: As an alternative to hand editing this file you can use the


    web admin tool to configure settings for your application. Use


    the Website->Asp.Net Configuration option in Visual Studio.


    A full list of settings and comments can be found in


    machine.config.comments usually located in


    \Windows\Microsoft.Net\Framework\v2.x\Config


    -->


    <configuration>


    <appSettings/>


    <connectionStrings>


    <remove name="LocalSqlServer" />


    <add name="LocalSqlServer" connectionString="Data Source="


    <DB_Server>


    ;Integrated Security=false;Initial Catalog=<DB_Name>


    ;User ID=<DB_User>


    ;Password=<DB_password>


    " providerName="System.Data.SqlClient" />


    </connectionStrings>


    <system.web>


    <!--


    Set compilation debug="true" to insert debugging


    symbols into the compiled page. Because this


    affects performance, set this value to true only


    during development.


    Visual Basic options:


    Set strict="true" to disallow all data type conversions


    where data loss can occur.


    Set explicit="true" to force declaration of all variables.


    -->


    <compilation debug="true" strict="false" explicit="true"/>


    <pages>


    <namespaces>


    <clear/>


    <add namespace="System"/>


    <add namespace="System.Collections"/>


    <add namespace="System.Collections.Specialized"/>


    <add namespace="System.Configuration"/>


    <add namespace="System.Text"/>


    <add namespace="System.Text.RegularExpressions"/>


    <add namespace="System.Web"/>


    <add namespace="System.Web.Caching"/>


    <add namespace="System.Web.SessionState"/>


    <add namespace="System.Web.Security"/>


    <add namespace="System.Web.Profile"/>


    <add namespace="System.Web.UI"/>


    <add namespace="System.Web.UI.WebControls"/>


    <add namespace="System.Web.UI.WebControls.WebParts"/>


    <add namespace="System.Web.UI.HtmlControls"/>


    </namespaces>


    </pages>


    <!--


    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" />


    </customErrors>


    -->


    </system.web>


    </configuration>
     
  4. ok i put in all the db info etc and i still get the error .whenever i put my mouse over DB-SERVER i get this statement THE ELMENT ADD NAME CANNOT CONTAIN CHILD ELMENT BECAUSE THE PARENTS CONTENT MODELELMENT IS EMPTY
    and also for pastsword ...and expecting tag should be close.
    And expecting end tag for connectionstring and change addname to one line
     
  5. Your connectionStrings in the web.config should look like this:

    <connectionStrings>
    <remove name='LocalSqlServer' />
    <add name='LocalSqlServer' connectionString='Data Source=xxxx.discountasp.net;Integrated Security=False;Initial Catalog=YOUR_SQL_DATABASE_NAME;User ID=YOUR_SQL_USERNAME;Password=YOUR_SQL_PASSWORD' providerName='System.Data.SqlClient' />
    </connectionStrings>

    Replace:
    <u>YOUR_SQL_DATABASE_NAME</u> by your database name
    <u>YOUR_SQL_USERNAME</u> by your database username
    <u>YOUR_SQL_PASSWORD </u> by your database password

    <u>Note:none of the above 3 should be in quotes,put them as it is.</u>

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  6. Thanks it work
    [​IMG]
     
  7. Is there adiff between this article-http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx
    and -- http://kb.discountasp.net/article.aspx?id=10413
    i have notice that one said application and the other said provider
    i'm a newbie
     
  8. Bruce

    Bruce DiscountASP.NET Staff

    YOu have to replace the place holder w/ your database information




    <add name="LocalSqlServer" connectionString="Data Source="


    <DB_Server>


    ;Integrated Security=false;Initial Catalog=<DB_Name>


    ;User ID=<DB_User>


    ;Password=<DB_password>


    " providerName="System.Data.SqlClient" />


    </connectionStrings>


    Items that needs to be replaced.


    Database Server Name
    Database_user
    Database Password


    And also keep the <add name ....> in 1 line.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  9. Bruce

    Bruce DiscountASP.NET Staff

Share This Page