I find the problem accidentally. In my ArcMap add-in, there is a search function which allows the user to search the geodb based on the value of a field. It works fine but today when I right click the title in the datagridview casually, the ArcMap crashed. After that I simulate the scenario several times, every time ArcMap crashes.
My code is listed bellow:
Sql = "SELECT ITEM_NO AS 'ITEM NO', ITEM_CATEGORY_NO AS 'ITEM CATEGORY NO', ARRIVAL_DATE AS 'ARRIVAL DATE' FROM testDB WHERE ITEM_NO = '" + item_No + "'" Try adapter = New SqlDataAdapter(Sql, connObj) adapter.Fill(ds) connObj.Close() DataGridView1.DataSource = ds.Tables(0) Catch ex As Exception MsgBox(ex.ToString) End Try
The result is:
Once I right click the part in the red frame, the map will crash.
Can anyone please tell me what's wrong with my code?