0

In my windows form application, I have placed database with in the project.

But I am not able to write anything into the database. My winforms can read all the contents of the database.

How can I solve this problem?

Currently the database is in the following location:

C:\Users\Amrit\Documents\Visual Studio 2012\Projects\Purchase Management\Purchase Management\Resources\App_Data

In app.config file I have this configuration:

<configuration>
    <configSections>
    </configSections>
    <connectionStrings>
        <add name="Database" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Resources\App_Data\Database.accdb;Persist Security Info=False;"
            providerName="System.Data.OleDb" />
        <add name="Purchase_Management.Properties.Settings.DatabaseConnectionString"
            connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Resources\App_Data\Database.accdb"
            providerName="System.Data.OleDb" />
    </connectionStrings>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
</configuration>

And I am accessing the database from classes using this;

string connString = ConfigurationManager.ConnectionStrings["Database"].ConnectionString;
4

1 回答 1

0

我认为,SQL File Writer 服务对该文件夹没有写入权限。您可以设置 ACL 或更改文件夹。

于 2013-02-17T09:17:48.760 回答