c# - How to connect to a local SQL server database in asp.net using Visual Studio 2013? -


how connect local sql server database in asp.net using visual studio 2013? i'm not talking remote access connection. in case, sql database located in app_data folder @ root of web application. want able query database c# file connected asp.net application , display data on label. have searched answer on hour , nothing seems show up.

for web.config connection string, try like:

<add name="connectionstringname"     providername="system.data.sqlclient"     connectionstring="data source=(localdb)\v11.0;attachdbfilename=c:\inetpub\wwwroot\webite\app_date\databasefilename.mdf;initialcatalog=databasename;integrated security=true;multipleactiveresultsets=true" /> 

(modified accordingly)


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -