c# - Application should not look for connection string in app.config file -
my application based on entity framework 5, , connection string dynamically generated , used in application. working fine. problem if not put connection string in app.config file, gives error. app.config file should contain connection string. there way, can make process not find connection string in app.config file. work around can put dummy connection string, want should not in app.config file connection string. please help. !!
thanks in advance..
an application not @ connection strings, it's libraries use that. luckily question tagged entity-framework, guess somewhere instantiate new dbcontext()
. nice if show on line of code error occurs.
when search web "entity framework dbcontext pass connection string" , find this question links manual somewhere:
public dbcontext(string nameorconnectionstring)
so, supply valid connection string constructor when instantiating entity framework context (not name, again make in application's configuration).
Comments
Post a Comment