sql-server


How do I map my connection string to my app_data folder rather than use an absolute path?


I have a connection string that includes the absolute path to my database.
Here's my connection string:
// removed
I have 2 questions:
How do I convert the absolute path to look at my app_data folder instead
of adding a full string?
Is this a good /bad thing to do?
Thanks in advance.
You should be able to use the |DataDirectory| substitution string:
AttachDbFilename=|DataDirectory|MyDb.mdf
MSDN Link

Related Links

Informatica powercenter
Temporary table not created from dynamic query execution
How to process the data in the table, which is frequently inserted
Combine two columns and input the result in a different columns using SQL server
SQL Query to accept time difference
How to change my T-SQL query to overwrite a csv file rather than append data to it?
How to join multiple columns with only one foreign key using linq
Deleting millions on records while using log shipping - SQL Server
Restricting decimal places [duplicate]
Powershell T-SQL Update Statement Error in Function
How to close if case in SQL
Set RESTRICTED_USER on Azure SQL database
How to use highlight index parameter on ssrs
Suddenly msdb.dbo.sp_send_dbmail is unresponsive
Can you add to an SSIS object variable, appending?
How to remove duplicates when use full join and have null values in cells

Categories

HOME
python
nlp
webrtc
google-sheets-api
extract
tomcat7
propertygrid
branch.io
jrebel
ext.net
aruco
click
xamarin-studio
wordpress-theming
cortex-a
uiscrollview
store
spring-cloud-config
bar-chart
scenebuilder
off-canvas-menu
jive
google-maps-android-api-2
hhvm
iup
nmf
pipelinedb
geopandas
ab-initio
hana-studio
winscp
partial-application
reactiveui
weinre
multichoiceitems
percentage
postgresql-9.2
expand
google-drive-realtime-api
ocs
transient
ksoap
image-compression
fax
spring-bean
scalafx
double-buffering
cgcontext
etherpad
in-memory-database
teiid
uistackview
jackson-databind
spinlock
search-regex
asp.net-mvc-partialview
multinomial
insertion-sort
data-import
hyperthreading
ffserver
xjc
pyopengl
sparse-file
ibm-data-studio
pylearn
xaml-designer
hg-git
grunt-contrib-concat
sortable
facebook-wall
lov
visual-c++-2010-express
jquery-tabs
wic
nsmatrix
installshield-2011
vertical-scrolling
abnf
icsharpcode
autostart
couchdb-lucene
scrollto
text-services-framework
law-of-demeter
goliath
carbide
trampolines
grooveshark
oggvorbis
windows-controls
handheld

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App