问题描述
下了一个.net源码,调试时出现数据库连接失败,需修改weblibrary中的配置信息,我想把sqlserver改为mysal,怎么改呀?<?xmlversion="1.0"encoding="utf-8"?><configuration><appSettings><!--CacheSetting默认缓存--><addkey="EnableCaching"value="false"/><addkey="CacheDuration"value="1800"/><!--默认翻页--><addkey="PageSize"value="20"/><!--是否启用验证码--><addkey="ValidateCode"value="true"/><!--2010-1-11增加By:海涛--><addkey="ProductName"value="西部数字房屋中介信息管理系统|-51aspx.com"/><addkey="Version"value="v2.2.1"/><addkey="WorkDate"value="8:30"/><addkey="WorkDateOut"value="5"/><addkey="ApiKey"value="adbe59c2dee11ce4a1d8b0025bfeb149"/></appSettings><connectionStrings><!--DataSource=数据库服务器IP;InitialCatalog=数据库名称;uid=账号;pwd=密码;--><addname="ConnectionString"connectionString="DataSource=127.0.0.1;InitialCatalog=fcoa;uid=sa;pwd=sa;"providerName="System.Data.SqlClient"/></connectionStrings><tableSection><addtableName="Callinrec"providerType="Digitwest.DAL.SqlClient.SqlCallinrecProvider"/><addtableName="Checkonwork"providerType="Digitwest.DAL.SqlClient.SqlCheckonworkProvider"/><addtableName="Dept"providerType="Digitwest.DAL.SqlClient.SqlDeptProvider"/><addtableName="HireAgreement"providerType="Digitwest.DAL.SqlClient.SqlHireAgreementProvider"/><addtableName="Hirelog"providerType="Digitwest.DAL.SqlClient.SqlHirelogProvider"/><addtableName="Hiresucc"providerType="Digitwest.DAL.SqlClient.SqlHiresuccProvider"/><addtableName="Househire"providerType="Digitwest.DAL.SqlClient.SqlHousehireProvider"/><addtableName="Housesale"providerType="Digitwest.DAL.SqlClient.SqlHousesaleProvider"/><addtableName="Images"providerType="Digitwest.DAL.SqlClient.SqlImagesProvider"/><addtableName="Jjr"providerType="Digitwest.DAL.SqlClient.SqlJjrProvider"/><addtableName="Notify"providerType="Digitwest.DAL.SqlClient.SqlNotifyProvider"/><addtableName="PublicInfo"providerType="Digitwest.DAL.SqlClient.SqlPublicInfoProvider"/><addtableName="Role"providerType="Digitwest.DAL.SqlClient.SqlRoleProvider"/><addtableName="SaleAgreement"providerType="Digitwest.DAL.SqlClient.SqlSaleAgreementProvider"/><addtableName="Salelog"providerType="Digitwest.DAL.SqlClient.SqlSalelogProvider"/><addtableName="Salesucc"providerType="Digitwest.DAL.SqlClient.SqlSalesuccProvider"/><addtableName="User"providerType="Digitwest.DAL.SqlClient.SqlUserProvider"/><addtableName="Userrec"providerType="Digitwest.DAL.SqlClient.SqlUserrecProvider"/><!--2009-12-22增加By:海涛--><addtableName="PubClass"providerType="Digitwest.DAL.SqlClient.SqlPubClassProvider"/><!--/*begin<addtableName="$table$"providerType="Digitwest.DAL.SqlClient.Sql$table$Provider"/>end*/--></tableSection></configuration>
解决方案
解决方案二:
<!--DataSource=数据库服务器IP;InitialCatalog=数据库名称;uid=账号;pwd=密码;--><addname="ConnectionString"connectionString="DataSource=127.0.0.1;InitialCatalog=fcoa;uid=sa;pwd=sa;"providerName="System.Data.SqlClient"/>
这一块就是数据库连接。你要想把数据库从sqlserver迁到mysql上,那恐怕不是简单的改连接字符串了,数据访问层也需要改了。