Asp.net和Oledb连接 [英] Asp.net and Oledb Connection
本文介绍了Asp.net和Oledb连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我已经创建了一个访问文件(.mdb),并将其放置在项目的app_data文件夹中.当我运行应用程序时,它工作正常,但是当我将其部署到iiis服务器上时,它并没有采用我在创建应用程序时指定的确切路径应用程序...我应该如何从服务器连接到在创建Web应用程序时指定的路径.
在此先感谢...
hi everyone,,
I have created a access file(.mdb) and have placed that in app_data folder of the project.Its working fine when i run an application but when i deploy it on iiis server its not taking the exact path which i have specified while creating the application...How should i connect from the server to the path which i have specified while creating the web application.
Thanks in advance...
推荐答案
如果访问文件位于服务器本地,而不是在oledb连接字符串中使用确切路径,请尝试使用相对路径.像这样的东西:
If the access file is located locally in the server, instead of using exact path in your oledb connection string, try using relative path. Something like:
.\databasefolder\database.mdf
如果文件位于另一台服务器上,请使用UNC,例如:
If the file is located on another server, use UNC, something like:
\\server\share\path\database.mdf
这篇关于Asp.net和Oledb连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文