Solved

using the progress bar?

Posted on 2008-06-20
8
263 Views
Last Modified: 2013-12-16
I have the following code:

 private void ProcessSpreadSheet ()
        {
            Excel.Application xlApp = null; //  Excel application object
            Excel.Workbook xlWorkBook = null; //  Excel Workbook object
            Excel.Worksheet xlWorkSheet = null; //  Excel Worksheet object
            Excel.Range inputRange = null; //  Excel Worksheet Range object
            int rowCount = 0, currRow = 0; //  row iterator
            string gradeName = null; //  character input variables
            decimal Price = 0.00M; //  price as a decimal number
            Excel.Range cellPriceValue = null;
            Excel.Range cellGradeValue = null;
            Excel.Range cellDiscountValue = null;
            bool WheatIndicatorFlag = false;
            bool DurumIndicatorFlag = false;
            bool BarleyIndicatorFlag = false;
            bool DesBarleyIndicatorFlag = false;
            bool WarningErrorTab = false;

            decimal?[,] discounts = new decimal?[4, 3];
            string[,] discountnames = new string[4,3] { {"WheatTough", "WheatDamp", "WheatStone"},  
                                           {"DurumTough", "DurumDamp", "DurumStone"},
                                           {"BarleyTough", "BarleyDamp", "BarleyStone"},
                                           {"DesBarleyTough", "DesBarleyDamp", "N/A"} };
             
            int pricesColumn = 0;
            int count_rows = 0;
            decimal sum_prices = 0.00M;
            InitialPrices.InitialPriceReportingServiceWS.PriceListHeaderObject PLHO = new InitialPrices.InitialPriceReportingServiceWS.PriceListHeaderObject();
            PLHO.price_list_hdr_id = dr["PRICE_LIST_HDR_ID"].ToString();
                         
         
            //  Define the input SS and open the 1st worksheet
            xlApp = new Excel.Application();
            xlWorkBook = xlApp.Workbooks.Open(InputFileName.Text, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
            xlWorkSheet = ((Excel.Worksheet)(xlWorkBook.Worksheets.get_Item(1)));

            //  Store the rows and columns used in the input SS into inputRange
            inputRange = xlWorkSheet.UsedRange;

            //  Read all used rows in the input SS, starting at the 11th row (rows are numbered from 0)
            //  Data of interest is in columns O and R (numbered 15 and 18 respectively)
            //  Initial prices load file has the prices in column 16
           
            //  All other load files have their prices in column 18
            if (rbtnInitialPriceOption.Checked)
            {
                pricesColumn = 16;
            }
            else
            {
                pricesColumn = 18;
            }

            for (rowCount = 10; rowCount <= inputRange.Rows.Count; rowCount++)
            {
                //  Read the grade name and price
                //  skip rows where the grade name is empty
                //  validate each line, if invalid, call an write_error function, passing in rowCount, grade name, price, E/W flag, and ErrMsg
                bool ErrorCheck = false;
                try
                {
                    cellPriceValue = ((Excel.Range)(inputRange.Cells[rowCount, pricesColumn]));
                    bool CheckNumeric = IsNumeric(cellPriceValue.Value2.ToString());
                   
                    if (cellPriceValue.Value2.ToString().Length > 0 || cellPriceValue.Value2 != null)
                    {
                        if (cellPriceValue.Value2.ToString() == "Stones" || cellPriceValue.Value2.ToString() == "Tough")
                        {
                            currRow = rowCount + 1; //  skip a row to where the discounts are
                            break;
                        }

                        cellGradeValue = ((Excel.Range)(inputRange.Cells[rowCount, 15]));
                        gradeName = (cellGradeValue.Value2.ToString().Trim());

                        InitialPrices.InitialPriceReportingServiceWS.InitialPriceReportingService WS = new InitialPrices.InitialPriceReportingServiceWS.InitialPriceReportingService();
                        int GradeCodeDetailID = 0;
                        string Status = null;
                        string GradePoolCode = null;

                         
                        WS.GetGradeCodeDetailID(gradeName, ref  GradeCodeDetailID, ref GradePoolCode, ref Status);

                        // Check grade code Id and set the indicator flags.
                        if (GradeCodeDetailID.ToString() == "01") // Wheat
                            WheatIndicatorFlag = true;
                        if (GradeCodeDetailID.ToString() == "02") // Durum
                            DurumIndicatorFlag = true;
                        if (GradeCodeDetailID.ToString() == "04") // Barley
                            BarleyIndicatorFlag = true;
                        if (GradeCodeDetailID.ToString() == "64") // DesBarley
                            DesBarleyIndicatorFlag = true;

                        if (CheckNumeric)
                        {
                            Price = decimal.Parse(cellPriceValue.Value2.ToString());//
                            sum_prices += Price;
                         
                        }
                        else
                        {
                            InsertPriceListLoadError(PLHO.price_list_hdr_id.ToString(),
                                GradeCodeDetailID, rowCount + 1, gradeName, null, 'E',
                                "Price contains a non-numeric value.");
                            ErrorCheck = true;
                            WarningErrorTab = true;
                        }

                       
                         
                       

                        if (GradeCodeDetailID == -1)
                        {
                             InsertPriceListLoadError(PLHO.price_list_hdr_id.ToString(), GradeCodeDetailID, rowCount + 1, gradeName, Price, 'E',
                             "Grade Code not found in Grade Code Details table.");
                             ErrorCheck = true;
                             WarningErrorTab = true;
                        }
                           
                        if ((Price) < 0.00M)
                        {
                              InsertPriceListLoadError(PLHO.price_list_hdr_id.ToString(), GradeCodeDetailID, rowCount + 1, gradeName, Price, 'E',
                                "Price cannot be negative.");
                              ErrorCheck = true;
                              WarningErrorTab = true;
                        }

                       
                         ///////////////////////
                           

                         // Look at warnings 'W'
                         if ((Price) > 1000.00M)
                         {
                            InsertPriceListLoadError(PLHO.price_list_hdr_id, GradeCodeDetailID, rowCount + 1, gradeName,
                                              Price, 'W', "Price is over $1000.00.  Please confirm with SP&P.");
                             WarningErrorTab = true;
                         }
                         if ((Price) == 0.00M)
                         {
                            InsertPriceListLoadError(PLHO.price_list_hdr_id, GradeCodeDetailID, rowCount + 1, gradeName,
                                              decimal.Parse((0.00).ToString()), 'W', "Grade has no price.  Please confirm with SP&P.");
                            WarningErrorTab = true;
                         }

                         InitialPrices.InitialPriceReportingServiceWS.InitialPriceReportingService WSPLDO =
                             new InitialPrices.InitialPriceReportingServiceWS.InitialPriceReportingService();
                         InitialPrices.InitialPriceReportingServiceWS.PriceListDetailObject PLDO = new InitialPrices.InitialPriceReportingServiceWS.PriceListDetailObject();
                         PLDO.grade_code_dtl_id = GradeCodeDetailID;
                         PLDO.price_list_hdr_id = dr["PRICE_LIST_HDR_ID"].ToString();
                         PLDO.strght_price_amt = Price;
                         WSPLDO.InsertPriceDetail(PLDO, ref Status);
                         count_rows += 1;
                           
                                       
                        }
                     
                    }

                   catch
                   {
                      // Console.WriteLine("Blank Price encountered.  Likely a blank row.");
                   }

            }

How can I implemnt the backgroundWorker around this
 backgroundWorker1.RunWorkerAsync();
timer1.Start();


0
Comment
Question by:mathieu_cupryk
  • 4
  • 4
8 Comments
 
LVL 12

Expert Comment

by:topdog770
ID: 21831801
I included your code in my example, even it's almost all commmented out.

I also show how to handle an error condition.

Please let me know if you have questions
using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;
 

namespace WindowsApplication1

{

    public partial class Form1 :Form

    {

        BackgroundWorker _bw = new BackgroundWorker( );

        public Form1()

        {

            InitializeComponent( );
 

            _bw.WorkerSupportsCancellation = false; // don't allow/support cancelling

            _bw.WorkerReportsProgress = true;

            _bw.DoWork += new DoWorkEventHandler( BackgroundWorker_DoWork );

            _bw.ProgressChanged += new ProgressChangedEventHandler( BackgroundWorker_ProgressChanged );

            _bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler( BackgroundWork_WorkIsComplete );

        }
 

        void BackgroundWork_WorkIsComplete(object sender, RunWorkerCompletedEventArgs e)

        {

            if (e.Cancelled)

            {

                // response to a canceled job here

            }
 

            // WE CAN'T USE THIS VALUE SO...

            if (e.Error != null)

            {  // there was an error.. handle it here
 

            }
 

            this.tbMsg.Text = "Completed Successfullly";

            if (e.Result != null)

            {  // you can return result of the work here

                if (e.Result is DivideByZeroException)

                { // we know an error occurred!

                    tbMsg.Text = "Error: " + ((DivideByZeroException)e.Result).ToString( );

                }

            }

        }
 

        void BackgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)

        {

            this.pb.Value = e.ProgressPercentage;

            WorkerStatus ws = e.UserState as WorkerStatus;

            if (ws != null)

            {

                this.tbMsg.Text = ws.Msg;

            }

        }
 

        void BackgroundWorker_DoWork(object sender, DoWorkEventArgs e)

        {

            // adding object to convey status info back to form

            WorkerStatus workStatus = new WorkerStatus( );
 
 

            Excel.Application xlApp = null; //  Excel application object

            Excel.Workbook xlWorkBook = null; //  Excel Workbook object

            Excel.Worksheet xlWorkSheet = null; //  Excel Worksheet object

            Excel.Range inputRange = null; //  Excel Worksheet Range object

            int rowCount = 0, currRow = 0; //  row iterator 

            string gradeName = null; //  character input variables

            decimal Price = 0.00M; //  price as a decimal number

            Excel.Range cellPriceValue = null;

            Excel.Range cellGradeValue = null;

            Excel.Range cellDiscountValue = null;

            bool WheatIndicatorFlag = false;

            bool DurumIndicatorFlag = false;

            bool BarleyIndicatorFlag = false;

            bool DesBarleyIndicatorFlag = false;

            bool WarningErrorTab = false;
 

            decimal?[ , ] discounts = new decimal?[ 4, 3 ];

            string[ , ] discountnames = new string[ 4, 3 ] { {"WheatTough", "WheatDamp", "WheatStone"},  

                                           {"DurumTough", "DurumDamp", "DurumStone"}, 

                                           {"BarleyTough", "BarleyDamp", "BarleyStone"},

                                           {"DesBarleyTough", "DesBarleyDamp", "N/A"} };
 

            int pricesColumn = 0;

            int count_rows = 0;

            decimal sum_prices = 0.00M;
 

            workStatus.Msg = "Initializing Objects";

            _bw.ReportProgress( 2, workStatus );
 
 

            //InitialPrices.InitialPriceReportingServiceWS.PriceListHeaderObject PLHO = new InitialPrices.InitialPriceReportingServiceWS.PriceListHeaderObject( );

            //PLHO.price_list_hdr_id = dr[ "PRICE_LIST_HDR_ID" ].ToString( );
 
 

            //  Define the input SS and open the 1st worksheet

            xlApp = new Excel.Application( );

            xlWorkBook = xlApp.Workbooks.Open( e.Argument.ToString( ), Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing );

            xlWorkSheet = ((Excel.Worksheet)(xlWorkBook.Worksheets.get_Item( 1 )));
 

            //  Store the rows and columns used in the input SS into inputRange

            inputRange = xlWorkSheet.UsedRange;
 

            //  Read all used rows in the input SS, starting at the 11th row (rows are numbered from 0)

            //  Data of interest is in columns O and R (numbered 15 and 18 respectively)

            //  Initial prices load file has the prices in column 16
 

            //  All other load files have their prices in column 18

            //if (rbtnInitialPriceOption.Checked)

            //{

            //    pricesColumn = 16;

            //}

            //else

            //{

            //    pricesColumn = 18;

            //}
 
 
 

            for (rowCount = 0; rowCount < 25; rowCount++)

            {

                workStatus.Msg = "Processing Rows " + rowCount + " of 25";

                _bw.ReportProgress( 2 + rowCount, workStatus );
 
 

                // TO HANDLE ERROR... 
 

                try

                {

                    int zero = 0;

                    double d = 1 / zero;

                }

                catch (DivideByZeroException dze)

                {

                    e.Result = dze;

                    return;

                }
 

                //for (rowCount = 10; rowCount <= inputRange.Rows.Count; rowCount++)

                //{

                //    //  Read the grade name and price

                //    //  skip rows where the grade name is empty

                //    //  validate each line, if invalid, call an write_error function, passing in rowCount, grade name, price, E/W flag, and ErrMsg

                bool ErrorCheck = false;

                try

                {

                    //        cellPriceValue = ((Excel.Range)(inputRange.Cells[ rowCount, pricesColumn ]));

                    //        bool CheckNumeric = IsNumeric( cellPriceValue.Value2.ToString( ) );
 

                    //        if (cellPriceValue.Value2.ToString( ).Length > 0 || cellPriceValue.Value2 != null)

                    //        {

                    //            if (cellPriceValue.Value2.ToString( ) == "Stones" || cellPriceValue.Value2.ToString( ) == "Tough")

                    //            {

                    //                currRow = rowCount + 1; //  skip a row to where the discounts are

                    //                break;

                    //            }
 

                    //            cellGradeValue = ((Excel.Range)(inputRange.Cells[ rowCount, 15 ]));

                    //            gradeName = (cellGradeValue.Value2.ToString( ).Trim( ));
 

                    //            InitialPrices.InitialPriceReportingServiceWS.InitialPriceReportingService WS = new InitialPrices.InitialPriceReportingServiceWS.InitialPriceReportingService( );

                    //            int GradeCodeDetailID = 0;

                    //            string Status = null;

                    //            string GradePoolCode = null;
 
 

                    //            WS.GetGradeCodeDetailID( gradeName, ref  GradeCodeDetailID, ref GradePoolCode, ref Status );
 

                    //            // Check grade code Id and set the indicator flags.

                    //            if (GradeCodeDetailID.ToString( ) == "01") // Wheat

                    //                WheatIndicatorFlag = true;

                    //            if (GradeCodeDetailID.ToString( ) == "02") // Durum

                    //                DurumIndicatorFlag = true;

                    //            if (GradeCodeDetailID.ToString( ) == "04") // Barley

                    //                BarleyIndicatorFlag = true;

                    //            if (GradeCodeDetailID.ToString( ) == "64") // DesBarley

                    //                DesBarleyIndicatorFlag = true;
 

                    //            if (CheckNumeric)

                    //            {

                    //                Price = decimal.Parse( cellPriceValue.Value2.ToString( ) );//

                    //                sum_prices += Price;
 

                    //            }

                    //            else

                    //            {

                    //                InsertPriceListLoadError( PLHO.price_list_hdr_id.ToString( ),

                    //                    GradeCodeDetailID, rowCount + 1, gradeName, null, 'E',

                    //                    "Price contains a non-numeric value." );

                    //                ErrorCheck = true;

                    //                WarningErrorTab = true;

                    //            }
 
 
 
 
 

                    //            if (GradeCodeDetailID == -1)

                    //            {

                    //                InsertPriceListLoadError( PLHO.price_list_hdr_id.ToString( ), GradeCodeDetailID, rowCount + 1, gradeName, Price, 'E',

                    //                "Grade Code not found in Grade Code Details table." );

                    //                ErrorCheck = true;

                    //                WarningErrorTab = true;

                    //            }
 

                    //            if ((Price) < 0.00M)

                    //            {

                    //                InsertPriceListLoadError( PLHO.price_list_hdr_id.ToString( ), GradeCodeDetailID, rowCount + 1, gradeName, Price, 'E',

                    //                  "Price cannot be negative." );

                    //                ErrorCheck = true;

                    //                WarningErrorTab = true;

                    //            }
 
 

                    //            ///////////////////////
 
 

                    //            // Look at warnings 'W'

                    //            if ((Price) > 1000.00M)

                    //            {

                    //                InsertPriceListLoadError( PLHO.price_list_hdr_id, GradeCodeDetailID, rowCount + 1, gradeName,

                    //                                  Price, 'W', "Price is over $1000.00.  Please confirm with SP&P." );

                    //                WarningErrorTab = true;

                    //            }

                    //            if ((Price) == 0.00M)

                    //            {

                    //                InsertPriceListLoadError( PLHO.price_list_hdr_id, GradeCodeDetailID, rowCount + 1, gradeName,

                    //                                  decimal.Parse( (0.00).ToString( ) ), 'W', "Grade has no price.  Please confirm with SP&P." );

                    //                WarningErrorTab = true;

                    //            }
 

                    //            InitialPrices.InitialPriceReportingServiceWS.InitialPriceReportingService WSPLDO =

                    //                new InitialPrices.InitialPriceReportingServiceWS.InitialPriceReportingService( );

                    //            InitialPrices.InitialPriceReportingServiceWS.PriceListDetailObject PLDO = new InitialPrices.InitialPriceReportingServiceWS.PriceListDetailObject( );

                    //            PLDO.grade_code_dtl_id = GradeCodeDetailID;

                    //            PLDO.price_list_hdr_id = dr[ "PRICE_LIST_HDR_ID" ].ToString( );

                    //            PLDO.strght_price_amt = Price;

                    //            WSPLDO.InsertPriceDetail( PLDO, ref Status );

                    //            count_rows += 1;
 
 

                    //        }
 

                }
 

                catch

                {

                    // Console.WriteLine("Blank Price encountered.  Likely a blank row.");

                }

            }

        }
 

        private void ProcessSpreadSheet()

        {

        }
 

        private bool IsNumeric(string p)

        {

            return true;

        }
 

        private void button1_Click(object sender, EventArgs e)

        {

            Close( );

        }
 

        private void button2_Click(object sender, EventArgs e)

        {

            string fileName = @"c:\example.xls";
 

            if (!_bw.IsBusy)

            {  // simple approach to not allowing duplicate calls to a busy worker thread

                _bw.RunWorkerAsync( fileName );

            }

        }
 
 
 

        /// <summary>

        /// Required designer variable.

        /// </summary>

        private System.ComponentModel.IContainer components = null;
 

        /// <summary>

        /// Clean up any resources being used.

        /// </summary>

        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>

        protected override void Dispose(bool disposing)

        {

            if (disposing && (components != null))

            {

                components.Dispose( );

            }

            base.Dispose( disposing );

        }
 

        #region Windows Form Designer generated code
 

        /// <summary>

        /// Required method for Designer support - do not modify

        /// the contents of this method with the code editor.

        /// </summary>

        private void InitializeComponent()

        {

            this.pb = new System.Windows.Forms.ProgressBar( );

            this.tbMsg = new System.Windows.Forms.TextBox( );

            this.button1 = new System.Windows.Forms.Button( );

            this.button2 = new System.Windows.Forms.Button( );

            this.SuspendLayout( );

            // 

            // pb

            // 

            this.pb.Location = new System.Drawing.Point( 12, 72 );

            this.pb.Name = "pb";

            this.pb.Size = new System.Drawing.Size( 268, 23 );

            this.pb.TabIndex = 0;

            // 

            // tbMsg

            // 

            this.tbMsg.Location = new System.Drawing.Point( 12, 46 );

            this.tbMsg.Name = "tbMsg";

            this.tbMsg.Size = new System.Drawing.Size( 268, 20 );

            this.tbMsg.TabIndex = 1;

            // 

            // button1

            // 

            this.button1.Location = new System.Drawing.Point( 104, 103 );

            this.button1.Name = "button1";

            this.button1.Size = new System.Drawing.Size( 75, 23 );

            this.button1.TabIndex = 2;

            this.button1.Text = "OK";

            this.button1.UseVisualStyleBackColor = true;

            this.button1.Click += new System.EventHandler( this.button1_Click );

            // 

            // button2

            // 

            this.button2.Location = new System.Drawing.Point( 104, 17 );

            this.button2.Name = "button2";

            this.button2.Size = new System.Drawing.Size( 75, 23 );

            this.button2.TabIndex = 3;

            this.button2.Text = "Go!";

            this.button2.UseVisualStyleBackColor = true;

            this.button2.Click += new System.EventHandler( this.button2_Click );

            // 

            // Form1

            // 

            this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F );

            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;

            this.ClientSize = new System.Drawing.Size( 292, 129 );

            this.Controls.Add( this.button2 );

            this.Controls.Add( this.button1 );

            this.Controls.Add( this.tbMsg );

            this.Controls.Add( this.pb );

            this.Name = "Form1";

            this.Text = "Form1";

            this.ResumeLayout( false );

            this.PerformLayout( );

        }
 

        #endregion
 

        private System.Windows.Forms.ProgressBar pb;

        private System.Windows.Forms.TextBox tbMsg;

        private System.Windows.Forms.Button button1;

        private System.Windows.Forms.Button button2;

    }
 

    public class WorkerStatus

    {

        // can add anything else you want here

        public string Msg = "";

    }
 

    public class InsertPriceListLoadError

    {

        public InsertPriceListLoadError(object p, int GradeCodeDetailID, int p_3, string gradeName, decimal p_5, char p_6, string p_7)

        {
 

        }

    }
 

}

Open in new window

0
 

Author Comment

by:mathieu_cupryk
ID: 21832637
I am confused on the name of this
void BackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
  you change it?
0
 
LVL 12

Expert Comment

by:topdog770
ID: 21832668
Oh, sorry.  

I just created an event handler called BackgroundWorker_DoWork that gets called when you call the _bw.RunWorkerAsync function.

when this line in the program is called:

_bw.RunWorkerAsync( fileName );

this function is started, BackgroundWorker_DoWork
0
 

Author Comment

by:mathieu_cupryk
ID: 21832738
I am still confused how am I suppsose to call my ProcessExcll
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 12

Accepted Solution

by:
topdog770 earned 500 total points
ID: 21832883
Ok.. let's start at the beginning.

1. Clicking on the button with text of "Go!" calls this function
========================================
        private void button2_Click(object sender, EventArgs e)
        {

2. We set the name of the file we want to process
========================================
            string fileName = @"c:\example.xls";

3. We check to make sure the BackgroundWorker thread isn't busy
========================================

            if (!_bw.IsBusy)
            {  // simple approach to not allowing duplicate calls to a busy worker thread

4. If it's not busy we tell the BackgroundWorker thread to start working  ========================================
                _bw.RunWorkerAsync( fileName );
            }
        }

5. This line of code -->  _bw.RunWorkerAsync( fileName );
Causes our "BackgroundWorker_DoWork" function to be called
========================================

6.  I took the code from your ProcessSpreadSheet() function and
put it in the BackgroundWorker_DoWork
========================================

7.  I commented out most of your code and add two pieces of code
========================================

This part to show how to send a progress message to your Form
-------------------
workStatus.Msg = "Processing Rows " + rowCount + " of 25";
_bw.ReportProgress( 2 + rowCount, workStatus );

This part to show how one approach to handling an error condition during the processing of an excel file-------------------
// TO HANDLE ERROR...
 
                try
                {
                    int zero = 0;
                    double d = 1 / zero;
                }
                catch (DivideByZeroException dze)
                {
                    e.Result = dze;
                    return;
                }

8.  If you haven't already, please create a new project and copy the code snippet I added.
     This code snippet is complete, I included code that's created by the designer and the code that normally gets added to the program.cs file.

If you step through the code in the debugger, you'll see how each function is called and how the progress and result information gets from the back ground work thread... back into the form

0
 

Author Comment

by:mathieu_cupryk
ID: 21835579
 WorkerStatus ws = e.UserState as WorkerStatus;
          Error      2      The type or namespace name 'WorkerStatus' could not be found (are you missing a using directive or an assembly reference?)      C:\SvnWork\InitialPriceReporting\DotNet\InitialPriceReporting\Form1.cs      98      13      InitialPriceReporting
0
 

Author Comment

by:mathieu_cupryk
ID: 21869184
tod, do you have an email that I can send my stuff.
0
 
LVL 12

Expert Comment

by:topdog770
ID: 21869567
The WorkerStatus is a very simple class atttached to the bottom of the original code snippet.  

I included it so you could see how you can pass most anything back to the main thread when the BackgroundWorker thread is complete.

Sure, send to to michaell770 at hotmail.com
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now