0

I've written an app using the RSSBus QB ADO.net provider - VS 2010 and .net 4.0. I'm connecting to QB with the entityframework 6 and using linq.

I'm dynamically changing the connectionstring in order to manipulate the offline cache. Everything works great.

I've migrated the app to VS 2013 with .net 4.5. In vs2010/4.0 the QB entity object is of ObjectContext and in vs2013/4.5 the QB entity is of DbContext and I don't have the connectionstring property available.

Is there any other methodology to manipulate the cache settings on the connection?

JClarkCDS
  • 184
  • 2
  • 9

1 Answers1

0

DbContext does not directly have a Connection property but it does have Database which does contain a Connection object which should allow you to edit the connection string:

https://msdn.microsoft.com/en-us/library/system.data.entity.dbcontext%28v=vs.113%29.aspx

There's another method you can use involving a partial class shown here:

EF 5 Changing Connection String at Runtime

Community
  • 1
  • 1
Scott T
  • 99
  • 2
  • That's it Scott T! For some reason RSSBus (CDATA) changed the base object. I was able to change the connectionstring of the Database.Connection. Thanks. – JClarkCDS Jun 17 '15 at 05:34