我需要以編程方式在SQL Server CE4服務器上創建標準成員資格數據庫。我現在用的是asp.net通用供應商提供的會員如下所述:http://www.hanselman.com/blog/IntroducingSystemWebProvidersASPNETUniversalProvidersForSessionMembershipRolesAndUserProfileOnSQLCompactAndSQLAzure.aspx以編程方式在SQL Server CE上使用通用提供程序創建成員資格數據庫
我嘗試使用System.Web.Management SqlServices.Install()
如下:
SqlServices.Install("local.sdf", SqlFeatures.Membership, connectionString.ConnectionString);
但它總是拋出一個錯誤說,它不能連接到SQL Server數據庫。
我懷疑SqlServices.Install()
可能不支持連接到SQL Server CE,但我很好奇,如果其他人找到了解決方法。這是一個MVC3應用程序,我試圖在全新部署應用程序之前自動創建一個空數據庫。
供應商將爲您創建數據庫文件... – ErikEJ 2012-07-22 11:08:25