这是默认的连接字符串
<!--<add name="DefaultConnection" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\aspnet.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />-->
我现在有了这个连接字符串(删除了网址部分)
<add name="madsskipper_dk_dbEntities" connectionString="metadata=res://*/Areas.Units.UnitsModel.csdl|res://*/Areas.Units.UnitsModel.ssdl|res://*/Areas.Units.UnitsModel.msl;provider=System.Data.SqlClient;
我当时想要的是让inbuild使用我自己的数据库(所以它也可以部署)但只是更改connectionStringName =“madsskipper_dk_dbEntities”没有帮助,我只是得到了一个
参数异常{“无法找到请求的.Net Framework数据提供程序。可能未安装。”}
<profile defaultProvider="DefaultProfileProvider">
<providers>
<add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="madsskipper_dk_dbEntities" applicationName="/"/>
</providers>
</profile>
<membership defaultProvider="DefaultMembershipProvider">
<providers>
<add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="madsskipper_dk_dbEntities" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
</providers>
</membership>
<roleManager defaultProvider="DefaultRoleProvider">
<providers>
<add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="madsskipper_dk_dbEntities" applicationName="/"/>
</providers>
</roleManager>
<sessionState mode="InProc" customProvider="DefaultSessionProvider">
<providers>
<add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="madsskipper_dk_dbEntities" applicationName="/"/>
</providers>
</sessionState>
编辑:我想我需要添加这样的东西(仅使用SQL 2008而不是SQL Lite)
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite"/>
<add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite"/>
</DbProviderFactories>
</system.data>
答案 0 :(得分:0)