VB.NET filedialog Access Violation

0

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

vb.net
filedialog
asked on Stack Overflow Apr 23, 2020 by Khalid Kagzi • edited Jul 5, 2020 by Martijn Pieters

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0