c# - Getting progress when filling datatabe -


I have to get the current record stored in DataTable because the database server is in second place and the connection is slow so sometimes the record is something It may take time and I want to know how many records are downloaded.

This is a method of filling the data format:

  Public DataTable FillModetable (String SQL) {SqlDataAdapter myDataAdapter; SqlCommandBuilder mySqlCommandBuilder; Datableable datatable; MyDataAdapter = New SqlDataAdapter (sQuery, this.connection); MySqlCommandBuilder = New SqlCommandBuilder (mySqlDataAdapter); MyDataAdapter.SelectCommand.CommandTimeout = 240; Datable = new datatelle (); MySqlDataAdapter.Fill (DataTable); Return DataTable; }  

In this way I call method above: Datatable DT = new datatale ();

  Private Zero FillData () {string sql = "SELECT id, code, diskette from my file"; Dt.RowChanged + = New DataRowChangeEventHandler (this.dt_RowChanged); Dt = fillMyDataTable (SQL); Dt.AcceptChanges (); } Zero dt_RowChanged (Object Sender, DataRowChangeEventArgs E) {if (e.Action == DataRowAction.Add) {Console.WriteLine ("Current number of Rick:" + dt.ows.Count.ToString ()); }}  

Output must be like from 1904 to 2100 records. The problem is that the dt_RowChanged event is not removed. How to do this

UPDATE! The code works up until the dt_RowChanged event fires up, even the DT object is filled with records.

To fire the incident, try it. If this does not use the appropriate representative on the incident.

  Private Zero FillData () {string sql = "SELECT Id, Code, Desc from MyTable"); Dt = fillMyDataTable (SQL); Detour change change avenues args = new Detour change change (DT., RO, DT. RAVSTATE); Dt_RowChanged (this, Args); }  Update   

I have just seen that you did not change the event to DT_ARRO and you removed it. Maybe check your error again after all

  dt.RowChanged + = New DataRowChangeEventHandler (this.dt_RowChanged);  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -