标签:
1.配置连接字符串,可以配置多个
<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();
标签:
原文地址:http://www.cnblogs.com/touphery/p/4236061.html