Menu
This is my Code. Please tell me in which code i have to modify to rectify that error.?? Would be helpful to have the whole exception message/stack but in any case i suspect it's beacuse you are trying to access gui controls in the background worker thread which is strictly not allowed in windows. What i am trying to do is i am having a grid with 3 columns. Col 1 is displaying file path(c: excl.xls) second column a progressbar column and third one is a comment column So i am now retrieving the data from the first row of first col (path) and filling the datatable.
Later i am inserting the datas from this datatable in to database row by row and i have to show the number of inserting rows in the progressbar at the same time and once the progressbar reached its maximum value the col 3 text will be changed to the 'xxx rows inserted' I think i have posted the concept here. Please help me. Thanks for your time. So pass an array of the paths into the thread, that takes care of your reads then change any places where you are modifying the grid to use the progress method and pass into the second argument a cookie type class to carry the rowindex, colindex, update text?
Or the other way create a bunch of BeginInvokes that will switch into the gui thread for you, you could use anonymous delegates for that and the would be easy change to the code i prefer the cookie class way i ddescribed above as it's more elegant.
BackGroundWorker & ProgressBar & Delegates. Get SDK and tools. Quick access. Browse sample requests. BackGroundWorke r & ProgressBar & Delegates IntroductionEn este ejemplo abordo uno de los principales problemas que nos podemos encontrar al tratar de copiar un archivo pesado, enviar un correo con documentos adjuntos, carga de. Updating Progressbar on the MainUI Using either BackgroundWorker or invoke method(VB.net). To report back to the mainforms ui (Progressbar). PBar is a public intreger that counts as the progress count for the Progress bar. You can fire-hose the UI thread with too many updates. Do not use a type name like 'MainMenu' in a.