无法将其他项目的数据源应用到 gridview
Cannot apply data source from other project to gridview
我已经使用 asp.net 几年了,但今天是我第一次尝试使用设计器视图。
我尝试添加 gridview,但终究无法让它识别我的数据源。
我的数据源是一个 entity framework .edmx,位于我引用的同一解决方案中的单独项目中。我已经通过其他 类 手动访问它,没有任何问题。
尝试将数据源添加到 gridview 时,我遇到的第一个错误是
"the provider did not return a providermanifest instance"
我读到将 .edmx 的元数据处理设置为 "Copy to Output Directory" 应该可以解决此问题,但随后我得到了一个不同的错误:
"Unable to load the specified metadata resource"
我读到连接字符串可能是问题所在,但我尝试对其进行更改的任何内容都没有成功。这是它的当前状态:
<add name="ProjectEntities" connectionString="metadata=res://*/ProjectModel.csdl|res://*/ProjectModel.ssdl|res://*/ProjectModel.msl;provider=System.Data.SqlClient;provider connection string="data source=asdasd.com;initial catalog=asdasd;persist security info=True;user id=asdasd;password=asdasd;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
如有任何帮助,我们将不胜感激。
您的 <connectionStrings>
部分应该是这样的:
<connectionStrings>
<add name="ProjectEntities" connectionString="metadata=res://*/ProjectModel.csdl|res://*/ProjectModel.ssdl|res://*/ProjectModel.msl;provider=System.Data.SqlClient;provider connection string="data source=asdasd.com;initial catalog=asdasd;user id=asdasd;password=asdasd;MultipleActiveResultSets=True;App=EntityFramework""
providerName="System.Data.EntityClient" />
<add name="SiteSqlServer"
connectionString="Data Source=asdasd.com;Initial Catalog=asdasd;User ID=asdasd;Password=asdasd;MultipleActiveResultSets=True;Application Name=EntityFramework"
providerName="System.Data.SqlClient" />
</connectionStrings>
我已经使用 asp.net 几年了,但今天是我第一次尝试使用设计器视图。
我尝试添加 gridview,但终究无法让它识别我的数据源。
我的数据源是一个 entity framework .edmx,位于我引用的同一解决方案中的单独项目中。我已经通过其他 类 手动访问它,没有任何问题。
尝试将数据源添加到 gridview 时,我遇到的第一个错误是
"the provider did not return a providermanifest instance"
我读到将 .edmx 的元数据处理设置为 "Copy to Output Directory" 应该可以解决此问题,但随后我得到了一个不同的错误:
"Unable to load the specified metadata resource"
我读到连接字符串可能是问题所在,但我尝试对其进行更改的任何内容都没有成功。这是它的当前状态:
<add name="ProjectEntities" connectionString="metadata=res://*/ProjectModel.csdl|res://*/ProjectModel.ssdl|res://*/ProjectModel.msl;provider=System.Data.SqlClient;provider connection string="data source=asdasd.com;initial catalog=asdasd;persist security info=True;user id=asdasd;password=asdasd;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
如有任何帮助,我们将不胜感激。
您的 <connectionStrings>
部分应该是这样的:
<connectionStrings>
<add name="ProjectEntities" connectionString="metadata=res://*/ProjectModel.csdl|res://*/ProjectModel.ssdl|res://*/ProjectModel.msl;provider=System.Data.SqlClient;provider connection string="data source=asdasd.com;initial catalog=asdasd;user id=asdasd;password=asdasd;MultipleActiveResultSets=True;App=EntityFramework""
providerName="System.Data.EntityClient" />
<add name="SiteSqlServer"
connectionString="Data Source=asdasd.com;Initial Catalog=asdasd;User ID=asdasd;Password=asdasd;MultipleActiveResultSets=True;Application Name=EntityFramework"
providerName="System.Data.SqlClient" />
</connectionStrings>