但是编译不能通过啊
(544): 找不到类型或命名空间名称“progressBra1”(是否缺少 using 指令或程序集引用?)
这怎么解决啊?

try
            {
                System.Data.DataTable dt =(System.Data.DataTable) this.dataGrid1.DataSource; 
                                if(dt.Rows.Count==0)
                {
                    MessageBox.Show("对不起,你没有查询到任何记录,不能导出数据");
                }
                else
                {
                    Excel.Application excel= new Excel.Application();
                    int rowIndex=1;
                    int colIndex=0;
                    int dNum=dt.Rows.Count;
                    excel.Application.Workbooks.Add(true);
    
                
                                       foreach(DataColumn col in dt.Columns)
                    {    
                        colIndex++; 
                        excel.Cells[1,colIndex]=col.ColumnName;    
                                                                }
                                        foreach(DataRow row in dt.Rows)
                    {
                        rowIndex++;
                        colIndex=0;
                        foreach(DataColumn col in dt.Columns)
                        {
                            colIndex++;
                            excel.Cells[rowIndex,colIndex]=row[col.ColumnName].ToString();
                                   this.progressBra1.Value = rowIndex * 100 / dNum;
                        }
                    }
                                      
            
                
            
                                        
                    excel.Quit();
                    excel=null;
                    GC.Collect();
                }
            }
                    
            catch{MessageBox.Show("没有实例化对象,请先实例化对象");}
        }
(544): “Business.Sheets.BarcodeSearch”并不包含对“progressBra1”的定义
[此贴子已经被作者于2007-6-28 11:42:30编辑过]
