asp.net MVC 提供了DonNetOpenAuth的元件, 讓網站要串接社群網站的SSO變的很容易, 但是直接引用DonNetOpenAuth範例是會自動建立一個mdf檔 就無法使用原本要接的SQL server。 這裡是提供修改範例code的方式 讓DotNetOpenAuth照既定程式, 在SQL server中建立相關的table 1.修改web.config 在web.config中加上SQLserver的連接資訊 [add connectionstring="Data Source=server;Initial Catalog=coolstay;Integrated Security=False;user id=userID;password=password" name="Connection" providername="System.Data.SqlClient"] 2.修改InitializeSimpleMembershipAttribute.vb的連接設定 WebSecurity.InitializeDatabaseConnection("Connection", "UserProfile", "UserId", "UserName", autoCreateTables:=True) 3.修改AccountModels.vb連接設定 Public Sub New() MyBase.New("Connection") End Sub 如此一來 執行系統就會在SQLserver上 建立好相關的table了