I am currently developing an application using C # and MySQL Database Backend.
My program can eventually load a large amount of data from the database and add it to the data set that will be displayed in the DataGridView. I want to show the progress of filling the DataSet, but I don’t know how I can get a link to where it is in the database.
Below is the code that I have.
DatabaseWork dbase = new DatabaseWork();
try
{
dbase.openConnection();
MySqlDataAdapter myDA = new MySqlDataAdapter();
myDA.SelectCommand = new MySqlCommand(query, dbase.conn);
DataTable table = new DataTable();
myDA.Fill(table);
BindingSource bSource = new BindingSource();
bSource.DataSource = table;
tblDetails.DataSource = bSource;
//tblGrid.Columns[0].Visible = false;
}
catch (MySqlException ex)
{
dbase.displayError(ex.Message, ex.Number);
}
finally
{
dbase.closeConnection();
}
I know that I will have to put this section of code into the stream as a background worker, but how can I change this code to show the progress.
source
share