因此,如
on this msdn page所述,为您定义连接字符串时
sql Server Compact 3.5,您可以使用“数据目录”宏,如下所示:
sql Server Compact 3.5,您可以使用“数据目录”宏,如下所示:
Data Directory Support
sql Server Compact 3.5 now supports the Data Directory macro. This means that if you add the string |DataDirectory| (enclosed in pipe symbols) to a file path,it will resolve to the path of the database.For example,consider the connection string:
“Data Source= c:\program files\MyApp\Mydb.sdf”
When using Data Directory,you can instead use the following connection string:
“Data Source = |DataDirectory|\Mydb.sdf”
For more information,see How to: Deploy a sql Server Compact 3.5 Database with an Application.
但是,msdn上的“获取更多信息”链接实际上并没有提供更多信息.
所以我的问题是:
如何|数据目录|宏在运行时翻译?对于WinForm应用程序,它似乎只是给出可执行文件的位置.还是比这更复杂?