您的位置:首页 > 编程语言 > ASP

ASP.NET profile之 找不到存储过程'dbo.aspnet_CheckSchemaVersion'

2008-11-04 11:46 417 查看
今天早上做profile的测试,webconfig的配置如下:

<configuration>

<appSettings/>

<connectionStrings>

<add name="MsSqlConnString" connectionString="server=WSH-S0712002\SQL2005;user id=sa;password=CjchnwsCq53b4y;database=ReplaceShop;min pool size=4;max pool size=4;packet size=3072" providerName="System.Data.SqlClient"></add>

</connectionStrings>

<system.web>

<compilation debug="true"/>

<authentication mode="Forms"/>

<anonymousIdentification enabled="true"/>

<profile enabled="true" automaticSaveEnabled="false" defaultProvider="SupperStudentProvider">

<providers>

<add name="SupperStudentProvider" connectionStringName="MsSqlConnString" type="System.Web.Profile.SqlProfileProvider" applicationName="ReplaceShop 1.0"/>

</providers>

<properties>

<add name="FavoriteColor" allowAnonymous="true" defaultValue="Red" provider="SupperStudentProvider"/>

</properties>

</profile>

</system.web>

</configuration>

//Anonymous.aspx

<%@ Page Language="C#" %>

<script runat="server">

void Login(Object s, EventArgs e)

void Logout(Object s, EventArgs e)

void UpdateProfile(Object s, EventArgs e)

void Page_PreRender()

</script>

<html>

<head>

<title>Anonymous</title>

</head>

<body>

<form id="form1" runat="server">

<asp:Button ID="Button1"

Text="Login"

OnClick="Login"

Runat="Server" />

<asp:Button ID="Button2"

Text="Logout"

OnClick="Logout"

Runat="Server" />

<hr />

<asp:TextBox

id="txtFavoriteColor"

Runat="Server" />

<asp:Button ID="Button3"

Text="Update Profile"

OnClick="UpdateProfile"

Runat="Server" />

<hr />

<b>Username:</b>

<asp:Label

id="lblUsername"

Runat="Server" />

<br />

<b>Favorite Color:</b>

<asp:Label

id="lblFavoriteColor"

Runat="Server" />

</form>

</body>

</html>

发现如下错误:

找不到存储过程'dbo.aspnet_CheckSchemaVersion'

解决方法:

导航到目录C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727,执行aspnet_regsql.exe,一定要选对数据库(跟webconfig中connectionString中保持一致)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐