tags:

views:

88

answers:

1

hi sir/madam,

i realized that when i'm trying to create 2 instance of LinqToSql DataContext as below and SQL server using the same SPID for them.

my question is with following code, would LinQToSql established 2 database connections or 1? how to establish 2 different database connection using LinqToSql DataContext?

LinqToSqlDataContext m1 = new LinqToSqlDataContext(ConfigurationManager.ConnectionStrings["AdventureWorks_Linq"].ConnectionString); Employee e = m1.Employees.First();

LinqToSqlDataContext m2 = new LinqToSqlDataContext(ConfigurationManager.ConnectionStrings["AdventureWorks_Linq"].ConnectionString); Employee e1 = m2.Employees.First();

A: 

i found the answer.

thanks.

ksang