在该文件夹中有app_data文件夹,我的数据库名为vic.accdb ..我的问题是,当我们将dtatbase放在app_data文件夹中时,这将是连接字符串吗? [英] There is app_data folder in that folder there is my database named vic.accdb..my question is that will be the connection string when we put dtatbase in app_data folder?

查看:141
本文介绍了在该文件夹中有app_data文件夹,我的数据库名为vic.accdb ..我的问题是,当我们将dtatbase放在app_data文件夹中时,这将是连接字符串吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Provider = Microsoft.ACE.OLEDB.12.0; Data Source =C:\ Users \Hrishi \Documents\Visual Studio 2010 \WebSites\WebSite7 \ App_Data \vic.accdb





代码给我错误?

我知道当我们将数据库文件放在App_Data文件夹中时我们使用像〜\\App_Data \ id.accdb但它给了我错误所以请解决我的问题





提前谢谢



我尝试过:



Provider=Microsoft.ACE.OLEDB.12.0;Data Source="C:\Users\Hrishi\Documents\Visual Studio 2010\WebSites\WebSite7\App_Data\vic.accdb"


that code gives me error?
I know that when we put database file in App_Data folder we use like ~\\App_Data\vic.accdb but it gives me error so please solve my problem


Thanks in advance

What I have tried:

Provider=Microsoft.ACE.OLEDB.12.0;Data Source="C:\Users\Hrishi\Documents\Visual Studio 2010\WebSites\WebSite7\App_Data\vic.accdb"



它是给我错误的代码


it is the code that giving me error

推荐答案

使用 Server.MapPath(@〜\ App_Data \vic.accdb)代替。

但是......在网站上使用Access数据库并不是一个好主意:根据定义,网站是多用户的, d对于多用户访问,Access是一个非常非常糟糕的选择。它可以完成,但它在生产中给出了巨大的问题。



大多数托管服务提供SQL Server或MySQL,这两者都是为多用户设计的 - 我强烈建议您切换到其中一个。
Use Server.MapPath(@"~\App_Data\vic.accdb") instead.
But... using an Access database in a website is not a good idea: websites are by definition multiuser, and Access is a very, very poor choice for multiuser access. It can be done, but it gives huge problems in production.

Most hosting services provide either SQL Server or MySQL both of which are designed for multiuser - I'd strongly recommend you switch to one of those.


这篇关于在该文件夹中有app_data文件夹,我的数据库名为vic.accdb ..我的问题是,当我们将dtatbase放在app_data文件夹中时,这将是连接字符串吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆