C# DataGridView DataError Event Not Triggering

Joined
Sep 7, 2017
Messages
10
Reaction score
0
I'm sorry if this is the wrong place to be posting this, it seemed like the right forum for it.

I am trying to make a prototype program to connect to a MySQL database with C# but some of the tables contain invalid data.

When I run the program I keep getting the default DataError message. I have tried adding in this code to handle the error event:

Code:
        private void dataGridView1_DataError(object sender, DataGridViewDataErrorEventArgs anError)
        {
            anError.Cancel = true;
        }

That however doesn't work and I still get the default DataError message when it reaches the part of the table with the data. If anyone could help, I would really appreciate it, thanks.
 
Can you not handle the invalid data in your SQL query? This just seems like the wrong way to go about it. #justsaying
 
I have tried to, its varbinary data, and I have been unable to find a way to either skip the column or for C# to display the data without giving an error. I'm still pretty new to this, so sorry if I am missing something obvious >.<
 
I have tried to, its varbinary data, and I have been unable to find a way to either skip the column or for C# to display the data without giving an error. I'm still pretty new to this, so sorry if I am missing something obvious >.<

You mean you want to exclude that column from the grid? If so then just exclude the column for the SELECT
 
Just do what I do, wait for the app to go down in a ball of flames, then just restart it.

Edit: You guys have no sense of humor! :whistle:
 
Last edited:
Top
Sign up to the MyBroadband newsletter
X