ASP.NET 会员资格;有东西正在调用 dbo.aspnet_CheckSchemaVersion

发布于 2024-08-20 23:06:12 字数 275 浏览 2 评论 0原文

我正在使用 ASP.NET 会员资格。我在一个共享托管站点上运行它,在那里我有一个数据库模式,我可以运行它。 在服务器上生成数据库的脚本中,我将架构从“dbo”更改为其他架构;关于表、视图和 SP。 一切都很好,除了会员之外一切都很好;我可以联系数据库并提取记录。

但是,成员身份登录失败并显示消息:“找不到存储过程‘dbo.aspnet_CheckSchemaVersion’。” 这当然在我的数据库中称为“DBxx.aspnet_CheckSchemaVersion”。 这是从哪里调用的以及如何让它调用正确的模式?

I'm using ASP.NET Membership. I'm running it on a shared hosting site where I have an db schema I run things off.
In the scripts to generate the DB on the server I changed the schema from 'dbo' to this other schema; on the tables, views and SP's.
Thing work fine, with everything except the Membership; I'm able to contact the DB and pull up records.

However, the Membership-login fails with the message: "Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'."
This of course is called 'DBxx.aspnet_CheckSchemaVersion' in my database.
Where is this being called from and how can I make it call the correct schema?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怪我太投入 2024-08-27 23:06:12

它在 System.Web.Util.SecUtility 中被调用并且是硬编码的。除非你想重新发明轮子您需要重新配置您的数据库。我已经做到了。这不是脑部手术,而是大量的工作,而且隔离数据库的兴趣不符合我的书中的条件。

internal static void CheckSchemaVersion(ProviderBase provider, SqlConnection connection, string[] features, string version, ref int schemaVersionCheck)
{
    if (connection == null)
    {
        throw new ArgumentNullException("connection");
    }
    if (features == null)
    {
        throw new ArgumentNullException("features");
    }
    if (version == null)
    {
        throw new ArgumentNullException("version");
    }
    if (schemaVersionCheck == -1)
    {
        throw new ProviderException(SR.GetString("Provider_Schema_Version_Not_Match", new object[] { provider.ToString(), version }));
    }
    if (schemaVersionCheck == 0)
    {
        lock (provider)
        {
            if (schemaVersionCheck == -1)
            {
                throw new ProviderException(SR.GetString("Provider_Schema_Version_Not_Match", new object[] { provider.ToString(), version }));
            }
            if (schemaVersionCheck == 0)
            {
                SqlCommand command = null;
                SqlParameter parameter = null;
                foreach (string str in features)
                {
                    command = new SqlCommand("dbo.aspnet_CheckSchemaVersion", connection);
                    command.CommandType = CommandType.StoredProcedure;
                    parameter = new SqlParameter("@Feature", str);
                    command.Parameters.Add(parameter);
                    parameter = new SqlParameter("@CompatibleSchemaVersion", version);
                    command.Parameters.Add(parameter);
                    parameter = new SqlParameter("@ReturnValue", SqlDbType.Int);
                    parameter.Direction = ParameterDirection.ReturnValue;
                    command.Parameters.Add(parameter);
                    command.ExecuteNonQuery();
                    if (((parameter.Value != null) ? ((int) parameter.Value) : -1) != 0)
                    {
                        schemaVersionCheck = -1;
                        throw new ProviderException(SR.GetString("Provider_Schema_Version_Not_Match", new object[] { provider.ToString(), version }));
                    }
                }
                schemaVersionCheck = 1;
            }
        }
    }
}

It is being called in System.Web.Util.SecUtility and it is hardcoded. Unless you want to re-invent the wheel you need to re-provision your database. I have done it. Is not brain surgery but is a lot of work and the interest of segregating a database does not qualify in my book.

internal static void CheckSchemaVersion(ProviderBase provider, SqlConnection connection, string[] features, string version, ref int schemaVersionCheck)
{
    if (connection == null)
    {
        throw new ArgumentNullException("connection");
    }
    if (features == null)
    {
        throw new ArgumentNullException("features");
    }
    if (version == null)
    {
        throw new ArgumentNullException("version");
    }
    if (schemaVersionCheck == -1)
    {
        throw new ProviderException(SR.GetString("Provider_Schema_Version_Not_Match", new object[] { provider.ToString(), version }));
    }
    if (schemaVersionCheck == 0)
    {
        lock (provider)
        {
            if (schemaVersionCheck == -1)
            {
                throw new ProviderException(SR.GetString("Provider_Schema_Version_Not_Match", new object[] { provider.ToString(), version }));
            }
            if (schemaVersionCheck == 0)
            {
                SqlCommand command = null;
                SqlParameter parameter = null;
                foreach (string str in features)
                {
                    command = new SqlCommand("dbo.aspnet_CheckSchemaVersion", connection);
                    command.CommandType = CommandType.StoredProcedure;
                    parameter = new SqlParameter("@Feature", str);
                    command.Parameters.Add(parameter);
                    parameter = new SqlParameter("@CompatibleSchemaVersion", version);
                    command.Parameters.Add(parameter);
                    parameter = new SqlParameter("@ReturnValue", SqlDbType.Int);
                    parameter.Direction = ParameterDirection.ReturnValue;
                    command.Parameters.Add(parameter);
                    command.ExecuteNonQuery();
                    if (((parameter.Value != null) ? ((int) parameter.Value) : -1) != 0)
                    {
                        schemaVersionCheck = -1;
                        throw new ProviderException(SR.GetString("Provider_Schema_Version_Not_Match", new object[] { provider.ToString(), version }));
                    }
                }
                schemaVersionCheck = 1;
            }
        }
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文