使用VB.net进行多线程 [英] multi threading using VB.net

查看:197
本文介绍了使用VB.net进行多线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是多线程技术的新手.我的要求是从DB(Universe DB)中读取数据并创建报告并导出到excel.可能会创建多个报告,例如10到15个报告
在这里,我要做的是两个线程1)从DB读取报告数据2)使用每个数据创建excel
这些过程应作为后台过程.
请帮忙,任何实现此想法的想法都会受到赞赏.

在此先感谢.

Hi, I am very new to multi threading. my requirment is read the data from DB(universe DB) and create the report and export to excel. there might muliple report created say 10 to 15 reports
Here what i have to do is two threads 1) read the data from DB for reports 2)with each data create excel
And these process should work as background process.
Pls help, any idea to do this is deeply appreciated.

Thanks in Advance.

推荐答案

这并没有什么意义:为什么要有两个线程这样做?为什么没有线程(来自 BackgroundWorker [
That doesn''t make a whole load of sense: why have two threads doing this? Why not have a thread (from the BackgroundWorker[^] pool) for each report? Then it keeps the related tasks together - each thread reads data, create report, export to excel, end thread.
Otherwise, you have to pass data between the threads, presumably using some form of queue - it''s much easier to handle if the thread handles the whole task, particularly as the next stage can''t start until the previous one is complete.


这篇关于使用VB.net进行多线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆