question

AhmedMulu-6022 avatar image
0 Votes"
AhmedMulu-6022 asked karenpayneoregon commented

How can I solve this error message called "could not find file \bin\debug\openfiledialog1" in VB.Net

I am using VB.Net to develop a a database When I am trying to update the record the following error message will appear
"Could not find file 'C:\Users\Ahmed\Documents\Visual Studio 2010\Projects\ETH-NADO Information Retrieving System\ETH-NADO Information Retrieving System\bin\Debug\OpenFileDialog1'"

This is the code:

 If MsgBox("Are You Sure You Want to Update?" & keyid, vbYesNo + vbQuestion, "Update") = vbYes Then
             Dim fsreader As New FileStream(OpenFileDialog2.FileName, FileMode.Open, FileAccess.Read)

             Dim breader As New BinaryReader(fsreader)

             Dim imgbuffer(fsreader.Length) As Byte
             breader.Read(imgbuffer, 0, fsreader.Length)
             fsreader.Close()
             strsql = "update Test set [MissionCode]=@Mission,[TestType]=@TestType,[TestDate]=@TestDate,[Driver]=@Driver,[Place]=@Place,[Event]=@Event,[Analysis]=@Analysis,[Coordinator]=@Coordinator,[DCO]=@DCO,[Athl]=@Athl,[SportCode]=@SportCode,[DCF]=@DCF where MissionCode = [@Mission]"
             acscmd.CommandText = strsql
             acscmd.Connection = conn
             acscmd.Parameters.AddWithValue("@Mission", mission.Text)
             acscmd.Parameters.AddWithValue("@TestType", type.Text)
             acscmd.Parameters.AddWithValue("(@TestDate", tdate.Text)
             acscmd.Parameters.AddWithValue("@Driver", driver.Text)
             acscmd.Parameters.AddWithValue("@Place", place.Text)
             acscmd.Parameters.AddWithValue("@Event", tevent.Text)
             acscmd.Parameters.AddWithValue("@Analysis", analy.Text)
             acscmd.Parameters.AddWithValue("@Coordinator", coord.Text)
             acscmd.Parameters.AddWithValue("@DCO", dco.Text)
             acscmd.Parameters.AddWithValue("@Athl", ath.Text)
             acscmd.Parameters.AddWithValue("@SportCode", sport.Text)
             acscmd.Parameters.AddWithValue("@DCF", imgbuffer)
             dbconnect()
             acscmd.ExecuteNonQuery()
             acscmd.Dispose()
             Me.Close()
             SelectCommand("Select * from Test", "Test")
             Information.fillgrid()
             bind_data()
             'Information.filltext()
         End If
dotnet-visual-basic
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Which line of code is throwing the exception?

0 Votes 0 ·

0 Answers