Ok, I am sure this has been discussed by many people but despite scouring the internet, I could not find a reliable solution. In short, when I try to open a filedialog, it throws an access violation. The code and the errors:
Dim SetYearWiseDataFile As New OpenFileDialog
If SetYearWiseDataFile.ShowDialog(Me) = Windows.Forms.DialogResult.OK Then
My.Settings.YearWiseFile = SetYearWiseDataFile.FileName
DSSetYearFilePath.Tables(0).Rows(0).Item(1) = SetYearWiseDataFile.FileName
End If
System.AccessViolationException
HResult=0x80004003
Message=Attempted to read or write protected memory. This is often an indication that other memory
is corrupt.
Source=<Cannot evaluate the exception source>
StackTrace:
<Cannot evaluate the exception stack trace>
Note that this issue has suddenly popped up. Earlier, I was using a openfiledialog in the same form and it worked well and then suddenly I tried to use the code and now this issue. Am using VB.NET 2019 Windows 10 32 BIT
User contributions licensed under CC BY-SA 3.0