asp.net - Database is removed from Microsoft SQL Server, Why? -


i created new empty website in visual studio express 2013. created asp.net folder: app_data.

then went sql server management studio. created new database in provided path app_data of website created.

i named database "facebookdata"

then went visual studio; found database in app_data folder , in server explorer.

i went web.config, , under added

  <connectionstrings>     <add name="dataconnectionstring" connectionstring="data source=(localdb)\v11.0;attachdbfilename=|datadirectory|\facebookdata.mdf;integrated security=true" providername="system.data.sqlclient" />   </connectionstrings> 

i click build -> rebuild solution

when close sql server management studio, , reopen again. database named "facebookdata" missed sql server management studio databases list!!!.

i still find in visual studio in app_data folder , server express.

if close , open sql server management studio before adding web.config. database still exist in sql server management studio. makes me feel there wrong in connection string.

any clues?

your connection string says database should "attached" sql server when application run. have permanently living in sql server should use sql server management studio attach manually, way stays attached. need change connection string to

"server=your_sql_server_instance;database=facebookdata;integrated security=true"


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -