越过林子

  -- 代码中的bugs,够我吃上一辈子了。
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

在SQL 2000中使用ASPNETDB

Posted on 2006-10-20 17:39  啄木鸟  阅读(764)  评论(3编辑  收藏  举报

1、先在c:\Windosws\Microsoft.NET\Framework\v2.0.50215下,运行aspnet_regsql,之后按照提示做好SQL2000的配置,最后会产生一个叫aspnetdb的数据库。

2、配置web.config 文件(以下是我一个工程的web.config文件,大家修改为自己的IP、用户名、密码)
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    <appSettings/>
    <connectionStrings>
      <add name="MySqlProviderConnection" connectionString="server=172.22.48.22;integrated security = true;Initial Catalog=aspnetdb;User ID=sa;Password=123456" />
      <add name="Lwga2ConnectionString" connectionString="Data Source=172.22.48.22;Initial Catalog=abcd;User ID=sa;Password=123456"
            providerName="System.Data.SqlClient" />
    </connectionStrings>
    <system.web>
      <membership>
        <providers>
          <add connectionStringName="MySqlProviderConnection" name="MySqlMembershipProvider"
            type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        </providers>
      </membership>
      <profile>
        <providers>
          <add name="MySqlProfileProvider" connectionStringName="MySqlProviderConnection" applicationName="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        </providers>
      </profile>
      <roleManager enabled="true">
        <providers>
          <add connectionStringName="MySqlProviderConnection" applicationName="/"
            name="MySqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
          <add applicationName="/" name="MyWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        </providers>
      </roleManager>


        <compilation debug="false" />

        <authentication mode="Forms" />
    </system.web>
</configuration>