0
내 Windows 응용 프로그램에서 데이터베이스를 프로젝트에 배치했습니다.데이터베이스에 쓸 수 있지만 읽을 수 없습니다
하지만 데이터베이스에 아무것도 쓸 수 없습니다. 내 winforms는 데이터베이스의 모든 내용을 읽을 수 있습니다.
이 문제를 어떻게 해결할 수 있습니까?
현재 데이터베이스는 다음 위치에 있습니다
C:\Users\Amrit\Documents\Visual Studio 2012\Projects\Purchase Management\Purchase Management\Resources\App_Data
파일 app.config
에서 나는이 구성이 :
<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>
그리고 내가 이것을 사용하여 클래스에서 데이터베이스에 액세스 오전;
string connString = ConfigurationManager.ConnectionStrings["Database"].ConnectionString;
그럼 쓰려고하면 어떻게 될까요? –
데이터베이스의 사용자에게 쓰기 권한이 있습니까? – VladHQ
글쎄, 루트 프로젝트 폴더는 읽기 전용이라고 말합니다. 하지만 내가 읽기 전용을 제거하고 다시 확인해도 다시 읽기 전용이됩니다 –