How to run a progress-bar through an insert query?

Posted by Gold on Stack Overflow See other posts from Stack Overflow or by Gold
Published on 2010-03-13T06:16:03Z Indexed on 2010/03/13 7:15 UTC
Read the original article Hit count: 159

Filed under:
|

I have this insert query:

try {
  Cmd.CommandText = @"INSERT INTO BarcodTbl SELECT * FROM [Text;DATABASE=" + PathI + @"\].[Tmp.txt];";
  Cmd.ExecuteNonQuery();
  Cmd.Dispose();
} catch (Exception ex) { 
  MessageBox.Show(ex.Message); 
}

I have two questions:

  1. How can I run a progress-bar from the beginning to the end of the insert?

  2. If there is an error, I got the error exception and the action will stop - the query stops and the BarcodTbl is empty. How I can see the error and allow the query to continue filling the table?

© Stack Overflow or respective owner

Related posts about c#

Related posts about query