簡介
先決條件
將MySQL 與ASP.NET MVC 2 整合的步驟
修改 web.config:
<connectionStrings> <add name="MySqlMembershipConnection" connectionString="Data Source=[MySql server host name];userid=[user];password=[password];database=[database name];" providerName="MySql.Data.MySqlClient"/> </connectionStrings> <membership defaultProvider="MySqlMembershipProvider"> <providers> <add name="MySqlMembershipProvider" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="MySqlMembershipConnection" /> </providers> </membership> <roleManager enabled="true" defaultProvider="MySqlRoleProvider"> <providers> <add name="MySqlRoleProvider" type="MySql.Web.Security.MySQLRoleProvider, MySql.Web, Version=6.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="MySqlMembershipConnection" /> </providers> </roleManager> <profile> <providers> <add name="MySqlProfileProvider" type="MySql.Web.Security.MySQLProfileProvider, MySql.Web, Version=6.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="MySqlMembershipConnection" /> </providers> </profile>
其他提示
結論
透過執行以下步驟,您可以有效地將MySQL 與ASP.NET MVC 2 集成,使您能夠在Web 應用程式中利用MySQL 的優勢。以上是如何將 MySQL 與 ASP.NET MVC 2 整合:逐步指南?的詳細內容。更多資訊請關注PHP中文網其他相關文章!