Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 22nd, 2006, 05:21 AM
Authorized User
 
Join Date: Jun 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default change default aspnetdb to SQL server 2000

Hi ,
        I have created a ASP.NET 2.0 website. It runs successfully on my local PC with Win XP. But, now i would like to publish the entire website to our dedicated server with SQL server 2000 (serversms2003). i just want to authenticate users using the aspnetdb on serversms2003. But for my web application, i want to use another SQL server 2000 & use dabatbase "bradford" on simsserver.
I ran the steps to create the aspnetdb thru the utility aspnet_regsql on serversms2003.
The problem now is that the website still takes the users from the app_data folder which contains the ASPNETDB.MDF file. I want the application to take users defined in SQL server 2000 on serversms2003. Pls help !!!
My web.config is as : (Note there are some lines with commnents)
<?xml version="1.0" encoding="utf-8" ?>
<!--
    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>
    <add key="CrystalImageCleaner-AutoStart" value="true" />
    <add key="CrystalImageCleaner-Sleep" value="60000" />
    <add key="CrystalImageCleaner-Age" value="120000" />
  </appSettings>
  <connectionStrings>
    <add name="BradfordConnectionString" connectionString="Data Source=simsserver;Initial Catalog=Bradford;Persist Security Info=false;User ID=sa" providerName="System.Data.SqlClient"/>

    <add name="DBConn" connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=aspnetdb;Data Source=serversms2003" 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.
        -->
    <webParts>
      <personalization defaultProvider="AspNetSqlPersonalizationProvider" >
        <providers>
          <remove name="AspNetSqlPersonalizationProvider" />
          <add name="AspNetSqlPersonalizationProvider"
          type="System.Web.UI.WebControls.WebParts.SqlPerson alizationProvider"
          connectionStringName="DBConn"
          applicationName="/" />
        </providers>
      </personalization>
    </webParts>

    <!--<membership>
      <providers>
        <remove name="AspNetSqlMembershipProvider" />
        <add name="AspNetSqlMembershipProvider"
          type="System.Web.Security.SqlMembershipProvider,
           System.Web, Version=2.0.0.0, Culture=neutral,
           PublicKeyToken=b03f5f7f11d50a3a"
          connectionStringName="LocalSQLServer"
          enablePasswordRetrieval="false"
          enablePasswordReset="true"
          requiresQuestionAndAnswer="true"
          applicationName="/"
          requiresUniqueEmail="false"
          passwordFormat="Hashed"
          maxInvalidPasswordAttempts="5"
          minRequiredPasswordLength="7"
          minRequiredNonalphanumericCharacters="1"
          passwordAttemptWindow="10"
          passwordStrengthRegularExpression="" />
      </providers>
    </membership>
    <profile>
      <providers>
       <remove name="AspNetSqlProfileProvider" />
       <add name="AspNetSqlProfileProvider"
           connectionStringName="LocalSQLServer"
           applicationName="/"
           type="System.Web.Profile.SqlProfileProvider,
             System.Web, Version=2.0.0.0, Culture=neutral,
             PublicKeyToken=b03f5f7f11d50a3a" />
       </providers>
    </profile>
    <roleManager enabled ="true ">
      <providers>
        <remove name="AspNetSqlRoleProvider" />
        <add name="AspNetSqlRoleProvider"
           connectionStringName="LocalSQLServer"
           applicationName="/"
           type="System.Web.Security.SqlRoleProvider,
             System.Web, Version=2.0.0.0, Culture=neutral,
             PublicKeyToken=b03f5f7f11d50a3a" />
      </providers>
    </roleManager>-->
    <roleManager enabled="true"/>
    <compilation debug="true" strict="false" explicit="true">
      <assemblies>
        <add assembly="CrystalDecisions.CrystalReports.Engine, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
        <add assembly="CrystalDecisions.ReportSource, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
        <add assembly="CrystalDecisions.Shared, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
        <add assembly="CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
        <add assembly="CrystalDecisions.ReportAppServer.ClientD oc, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
        <add assembly="CrystalDecisions.Enterprise.Framework, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
        <add assembly="CrystalDecisions.Enterprise.InfoStore, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
      </assemblies>
    </compilation>
    <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.
        -->
    <!--
            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>
        -->
    <authentication mode="Forms" >
      <forms name=".ASPXAUTH"
         defaultUrl="login.aspx"
        loginUrl="login.aspx"
        protection="All"
        timeout="30"
        path="/"
        requireSSL="false"
        slidingExpiration="true"
        />
    </authentication>
    <!--<authorization>
            <deny users="?"/>
        </authorization>-->
    <authorization>
      <allow users="*"/>
    </authorization>
    <httpHandlers>
      <add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
    </httpHandlers>
  </system.web>
  <system.net>
    <mailSettings>
      <smtp from="[email protected]">
        <network host="XX.XX.XX.XX" password="XXXX" userName="[email protected]"/>
      </smtp>
    </mailSettings>
  </system.net>
</configuration>
 
Old July 13th, 2006, 02:27 PM
Authorized User
 
Join Date: Jul 2006
Posts: 13
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Same problem here

 
Old July 14th, 2006, 07:34 AM
Registered User
 
Join Date: Jul 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Add the following to your web.config and it'll pick up from the database you created on Sql Server instead of aspnetdb.mdf.
<connectionStrings>
    <remove name="LocalSqlServer" />
    <add name="LocalSqlServer" connectionString="data source={server address};Initial Catalog={database name};User Id={username};Password={password};" providerName="System.Data.SqlClient"/>
</connectionStrings>

Hope this helps.



 
Old July 14th, 2006, 07:50 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You may want to take a look at this article by Scott Guthrie: http://weblogs.asp.net/scottgu/archi...25/423703.aspx

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004





Similar Threads
Thread Thread Starter Forum Replies Last Post
Conflict in SQL Server 2000 and SQL Server 2005 ayan.mukherjee SQL Language 0 June 30th, 2008 03:34 AM
SQL Server 2000 and SQL Server 2000 CE dparsons SQL Server 2000 1 July 31st, 2006 12:59 PM
how to set up system time as default for SQL 2000 rainman12 SQL Server 2000 0 October 28th, 2005 10:14 PM
looking for access 2000 to sql server 2000 sql/que method SQL Server 2000 0 July 7th, 2005 12:46 PM
SQL SERVER 2000 AND ACCESS 2000 ckentebe SQL Server 2000 3 June 17th, 2004 08:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.