c# - Showing Data with SQL Database Error -


i try data local sql database. 1st code workis simple , write path directly.

string connstring = "data source=(localdb)\\mssqllocaldb;attachdbfilename=c:\\****\\****-\\desktop\\mssolution\\mssolution\\datatt.mdf;integrated security=true"; 

after research change code :

static string apppath = path.getdirectoryname(application.executablepath);     string connstring = "data source=(localdb)\\mssqllocaldb;attachdbfilename=" + apppath + "\\datatt.mdf;integrated security=true"; 

but problem it's not showing data. , question, app deploy exe setup, problems working local database

<connectionstrings>     <add name="contextname" connectionstring= "data source=.; database=dbname; integrated security=true" providername="system.data.sqlclient" />   </connectionstrings> 

is looking for...?


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -