vb.net - How do I construct the initial ConnectionString for EF 6.0 and above? -
vb.net - How do I construct the initial ConnectionString for EF 6.0 and above? -
vs2013 update 3, ef 6.1 using code first, vb
i have both mvc5 project , forms project in place larn how utilize ef 6. both projects work fine in local environment , both default utilize .\sqlexpress server. notice these initial template projects not have connectionstring in ~.config files. however, mvc5 project has defaultconnectionfactory element forms project has nil related ef.
1) how these projects establishing connection sql server?
2) if want connect different sql server add together connectionstring element ~.config file?
assuming reply (2) above correct, first create connectionstring specify same connection in utilize have known spot work from.
i found should valid connection string constructions in server explorer, have details of 'data source', 'initial catalog', , 'integrated security' flag. don't understand utilize name element of connectionstring , if maintain applications' connections local .\sqlexpress server.
i hope made sense...
thanks.
best regards, alan
this web.config code needed duplicate automatically done defaultconnectionfactory element:
<connectionstrings> <add name="blogcontext" providername="system.data.sqlclient" connectionstring="data source=<my pc name here>\sqlexpress;initial catalog=efmigration.blogcontext;integrated security=true;" /> </connectionstrings>
the of import points me were:
1) name element same context name
2) can't forget profidername attribute, note this thread
from string can apply web.config transformation elements.
best regards, alan
vb.net connection-string entity-framework-6
Comments
Post a Comment