我已经使用Visual Studio的默认网站创建Application.it的工作在本地机器罚款,但是当我其托管在服务器iis.it给出了错误删除本地数据库和asp.net登录控制会员提供
Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.
在我的数据库中没有这样的sp,我也不想使用成员provider.so我试图从web.config中删除本地连接,但仍然没有运气。
<remove name="LocalSqlServer" />
<clear />
<add name="LocalSqlServer" connectionString="Data Source=GGT\NNY;Initial Catalog=VersionControl;User ID=sa;Password=123" providerName="System.Data.SqlClient"/>
<add name="ConVersionControl" connectionString="Data Source=GGT\NNY;Initial Catalog=VersionControl;User ID=sa;Password=123" providerName="System.Data.SqlClient"/>
ConVersionControl
是我使用我的应用程序
以下连接是我使用的洛
protected void LoginButton_Click(object sender, EventArgs e)
{
try
{
dtUserDetails = new DataTable();
if (UserRepositoryBL.ValidateUser(LoginUser.UserName.Trim(), LoginUser.Password.Trim(), out dtUserDetails))
{
AuthUser au = new AuthUser();
if (dtUserDetails.Rows.Count > 0)
{
DataRow DR = dtUserDetails.Rows[0];
au.UserID = Convert.ToInt32(DR["UserID"].ToString());
au.UserNo = DR["UserNo"].ToString();
au.UserName = DR["UserName"].ToString();
au.Password = DR["Password"].ToString();
}
string userData = au.ToString();
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(
1, // Version number
LoginUser.UserName.Trim(), // Username
DateTime.Now, // Issue date
DateTime.Now.AddMinutes(60), // Expiration date
false, // Persistent?
userData // User data
);
string eticket = FormsAuthentication.Encrypt(ticket);
HttpCookie cookie = new HttpCookie
(FormsAuthentication.FormsCookieName, eticket);
Response.Cookies.Add(cookie);
BasePage.ActivityLog("User Login", LoginUser.UserName.Trim(), true, Request.RawUrl);
string url = FormsAuthentication.GetRedirectUrl(LoginUser.UserName, false);
Response.Redirect(url);
}
else
{
LoginUser.FailureText = "Your login attempt was not successful. Please try again.";
}
}
catch (Exception ex)
{
throw ex;
}
}
代码请注意,应用程序正常工作uccessful login.above 错误只有当我尝试使用无效的用户名或密码登录
我试图清除提供商现在是让“必须指定默认的成员资格提供程序”的错误 – chamara 2012-08-08 06:32:05
@ chamara - 看起来你的代码中某处还有一个无意的依赖关系。通过这里尝试工作http://msdn.microsoft.com/en-us/library/xdt4thhy.aspx – StuartLC 2012-08-08 06:45:41