I have a .NET program which pulls data from an Access Database. I'm a beginner at .NET and this is a very simple application with a combobox that filters a datagrid. I have used the following code to declare the datasource and to fill the dataadapter:
The problem occurs at the "dataAdapter.Fill(dt)" line. This is the error message I get when I try to run the code:
Apparently, there is a security setting that has to be set higher. I have been unable to find out how to set this. Any ideas?
Code:
Dim dt As New DataTable()
Private Sub frm_manager_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim connStr As String = "Provider =Microsoft.Jet.OLEDB.4.0;"
"Data Source = I:\SEED_SYS\SD-DATA\seed.mdb"
Dim sqlStr As String = "SELECT LabNumber.OldLabNumber, LabNumber.SampleType, LabNumber.ReportType, " & _
"LabNumber.LotNumber, LabNumber.Title, LabNumber.CompanyName, LabNumber.DateRec" & _
"FROM LabNumber;"
Dim dataAdapter As New OleDb.OleDbDataAdapter(sqlStr, connStr)
dataAdapter.Fill(dt)
dataAdapter.Dispose()
dg.DataSource = dt
The problem occurs at the "dataAdapter.Fill(dt)" line. This is the error message I get when I try to run the code:
Code:
System.Security.SecurityException was unhandled
Message="Request for the permission of type 'System.Data.OleDb.OleDbPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."
Apparently, there is a security setting that has to be set higher. I have been unable to find out how to set this. Any ideas?