itheOAKLANDATHLETICS
New Member
I am getting a "keyword not supported error" when I try to connect to a LocalDB database using ObjectContext.This is my connection string:\[code\]<add name="connStr" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=proj1db;Integrated Security=True" />\[/code\]and this is the code that tries to create an instance of the ObjectContext:\[code\]var connectionString = ConfigurationManager .ConnectionStrings["connStr"] .ConnectionString;ObjectContext _context = new ObjectContext(connectionString);\[/code\]The last line throws System.ArgumentException: Keyword not supported: 'data source'.I am using Visual Studio 2012 for Web and targeting .NET Framework 4.5. I have LocalDB installed on my machine.If I use DbContext instead it works:\[code\]public class proj1dbContext: DbContext{ public proj1dbContext() : base("name=connStr") ...\[/code\]It seems that this is a similar questionHelp with EF Code first connection stringbut unfortunately it does not give a definitive answer to why instantiating ObjectContext throws that error.Any help is appreaciated. Thanks!