获取连接字符串的提供者详细信息 [英] getting provider details for connection string
问题描述
对于我的连接字符串,我使用以下命令:
< connectionstring ="provider = microsoft.data.jet.oledb.4.0; data source = | datadirectory | \ db.mdb; ......>
我想知道在调试中运行应用程序时数据目录是什么.
我该怎么办?
顺便说一句-我的连接字符串位于与我的申请表("app"项目)不同的项目("DAL"项目)的app.config中
thanx!
Hi ,
for my connection string, I use this:
<connectionstring="provider=microsoft.data.jet.oledb.4.0;data source=|datadirectory|\db.mdb;...... >
I want to know what is the datadirectory while running the application in debug.
how can I do that?
by the way- my connectionstring is in the app.config of a different project ("DAL" project) from my application forms ("app" project)
thanx!
推荐答案
我的内存有点模糊,但是我相信您可以通过以下方式获得DataDirectory的值:
My memory is a bit fuzzy but I believe you can get the value of DataDirectory with:
Dim path As String = CStr(AppDomain.CurrentComain.GetData("DataDirectory"))
我还没有尝试过,只是隐约记得在某个地方看到它.
I haven''t tried it and only vaguely remember seeing it somewhere.
这篇关于获取连接字符串的提供者详细信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!