WebSecurity.InitializeDatabaseConnection - 如何指定DB模式? [英] WebSecurity.InitializeDatabaseConnection - How specify a db schema?

查看:269
本文介绍了WebSecurity.InitializeDatabaseConnection - 如何指定DB模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用SimpleMembership(的http://blog.osbornm.com/archive/2010/07/21/using-simplemembership-with-asp.net-webpages.aspx)但我不能让我的地方自定义的用户表中比其他DBO的模式。

I am using SimpleMembership (http://blog.osbornm.com/archive/2010/07/21/using-simplemembership-with-asp.net-webpages.aspx) but I am unable to have place my custom user table in a schema other than dbo.

例如,这个调用会固执地创建一个名为dbo.MySchema.User表

For example, this call will stubbornly create a table named "dbo.MySchema.User"

WebSecurity.InitializeDatabaseConnection(connectionStringName: "ApplicationServices", userTableName: "MySchema.User", userIdColumn: "ID", userNameColumn: "Username", autoCreateTables: true);

我也试过手动创建表,但图书馆仍试图运行查询时追加DBO。

I also tried creating the table manually but the library still tries to append "dbo" when running the query.

我需要一个定制的提供者?我不是100%肯定,如果我将用SimpleMembership但它可以救我写了一堆用户/ AUTH code的麻烦。

Do I need a custom provider? I'm not 100% sure if I will use SimpleMembership however it could save me the trouble of writing a bunch of user/auth code.

http://msdn.microsoft.com /en-us/library/gg569134(v=VS.99).aspx

推荐答案

我用我自己的用户模式。

I use my own schema for users.

我的表名为 CORE.PROFILES ,与websecurity工作,我有一个SQL代名词 dbo.PROFILES

My table is called CORE.PROFILES, to work with websecurity I have a SQL synonym dbo.PROFILES.

要做到这一点运行在SQL Server中的语句:

To do it run this statement in SQL Server:

CREATE SYNONYM dbo.profiles FOR core.profiles;

我希望这帮助你。

I hope this help you.

这篇关于WebSecurity.InitializeDatabaseConnection - 如何指定DB模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆