You are using |DataDirectory|, which is a placeholder for the actual directory. If not defined otherwise it will be mapped to your application's directory...
If you want the connection engine to look for a different path you should use
AppDomain.CurrentDomain.SetData("DataDirectory", "[your path to the db file]");