MVC DataBaseFirst连接数据库
<add name="MetaSearchConnectionString" connectionString="Data Source=(local);Initial Catalog=MetaSearchDB;Persist Security Info=True;User ID=sa;Password=12345012345;Pooling=true;Min Pool Size=20;Max Pool Size=50000;" providerName="System.Data.SqlClient" />
<!--现存数据库连接串-->
<add name="MetaSearchConnectionString" connectionString="Data Source=(local);Initial Catalog=MetaSearchDB;Persist Security Info=True;User ID=sa;Password=12345012345;Pooling=true;Min Pool Size=20;Max Pool Size=50000;" providerName="System.Data.SqlClient" />
<add name="MetaSearchDBEntities1" connectionString="metadata=res://*/DBEntities.DB1.csdl|res://*/DBEntities.DB1.ssdl|res://*/DBEntities.DB1.msl;provider=System.Data.SqlClient;provider connection string="data source=(local);initial catalog=MetaSearchDB;persist security info=True;user id=sa;password=12345012345;pooling=True;min pool size=20;max pool size=50000;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient" />
MetaSearchDBEntities1 dben = new MetaSearchDBEntities1();
var a = dben.M_MonitorSword.ToList();
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。