views:

9

answers:

1

I am creating a SQL Compact demo, and I want to point the connection string in my App.config file to %CommonAppDataFolder% (the Special Folder token that points to c:\ProgramData on Windows 7 machines). My current connection string hard-codes the ProgramData folder reference:

Data Source=c:\ProgramData\Foresight Systems\SQL Compact Demo\LocalData.sdf

I'd like to change it to something like this:

Data Source=%CommonAppDataFolder%\Foresight Systems\SQL Compact Demo\LocalData.sdf

Obviously, that doesn't work. So, my question is: What is the correct syntax to embed a Special Folder in a connection string? Thanks for your help.

A: 

Based on the answer here, I have come to the conclusion that it simply can't be done. If anyone knows of a way to embed a Special Folder token in a connection string in App.config, I'll be happy to change the accepted answer.

David Veeneman