Could be throwing a null reference exception as well.
Try replacing:
TextBox1.Text = myDataSet.Tables(0).Rows(SelectedIndex).Item("Equipment_ID").ToString
With:
TextBox1.Text = IIF(IsDBNull(myDataSet.Tables(0).Rows(SelectedIndex)("Equipment_ID")),"",myDataSet.Tables(0).Rows(SelectedIndex)("Equipment_ID"))
Begginnerdev
Practically a Posting Shark
861 posts since Apr 2010
Reputation Points: 184
Solved Threads: 142
Skill Endorsements: 8
What I can not understand is how that code even runs such that he can see an empty textbox. Only the command variable (cmd) has an instance assigned to it.
Suggest changing:
Dim myDA As SqlCeDataAdapter
Dim myDataSet As DataSet
to:
Dim myDA As New SqlCeDataAdapter
Dim myDataSet As New DataSet
TnTinMN
Practically a Master Poster
640 posts since Jun 2012
Reputation Points: 418
Solved Threads: 148
Skill Endorsements: 13
If you take a screen shot of the the exception that is thrown, along with the message - We can trouble shoot it for you (hopefully)
Try placing MsgBox(ex.ToString) in the Try/Catch block.
Try
'Your Code Here
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Begginnerdev
Practically a Posting Shark
861 posts since Apr 2010
Reputation Points: 184
Solved Threads: 142
Skill Endorsements: 8