visual studio 2013 - connect to DataBase .mdf (Class Labrary) from web app -


i want connect db .mdf web application located in classlabrary project.

when write:

    private const string url = @"data source=(localdb)\v11.0;                         attachdbfilename=*full path*;                         integrated security=true"; 

it works.

but when write:

    private const string url = @"data source=(localdb)\v11.0;                         attachdbfilename=|datadirectory|\localdb.mdf;                         integrated security=true"; 

it doesnt work.

the error : "an exception of type 'system.data.sqlclient.sqlexception' occurred in system.data.dll not handled in user code"

i want connectionstring not specific on 1 computer. have suggest how can solve it?

the project locate under same solution works on visual studio 2013 thanks


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -