SQL Database C#的通信间隔? [英] SQL Database c# communication interval?

查看:85
本文介绍了SQL Database C#的通信间隔?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,伙计们.我需要你的帮助.我在VS中的c#中有一个运行主窗体的程序.该主窗体将数据存储到表中,并将数据导出到SQL数据库.导出的数据是很多数据(600,000 +行).我有一个问题.在我的主窗体上,我需要有一个数据库写出间隔".这是将多少行"导入数据库的数量.但是我的问题是如何实现该间隔的步骤.主窗体运行,并且在完成主程序后,sql仍需要5-10分钟才能接收IN数据.因此,如果我关闭主窗体,则其余数据将无法导入.您那里的专业程序员是否知道我可以以某种方式与SQL通信以仅在用户指定的时间间隔内导出数据的方式.这必须通过我的c#类完成.我不知道从哪里开始.我认为计时器不是一个好主意,因为不同的计算机和cpu的执行方式有所不同.任何建议将不胜感激.

OK guys. I need your help. I have a program in c# in VS that runs a mainform. That mainform exports data to an SQL Database with stored procedures into tables. The data exported is a lot of data (600,000 + rows). I have a problem tho. On my mainform I need to have a "database write out interval". This is a number of how many "rows" will be imported into the database. My problem is however the steps on how to implement that interval. The mainform runs, and when the main program is done, the sql still takes IN data for another 5-10 minutes. Therefore, if I close the mainform, the rest of the data will not me imported. Do you professional programmers out there know a way where I can somehow communicate with SQL to only export data for a user-specified interval. This has to be done with my c# class. I dont know where to begin. I dont think a timer would be a good idea because differenct computers and cpu''s perform differently. Any advice would be appreciated.

推荐答案

因此,在过程完成之前,请勿关闭主窗体(或应用程序).您还可以显示某种进度条/进度条,通知用户仍有很长的路要走.我相信其他人也可以提出不同的答案,但这应该可以帮助您.
So don''t allow the main form (or application) to close until the process is complete. You could also display some sort of progress meter/bar that informs the user that there is still quite a way to go. I''m sure others can come up with different answers as well but that should get you going.


感谢您的答复.但是我的问题在这里有点复杂.在将数据导出到数据库时,该主窗体将对用户具有其他用途.我需要的是:用户输入我要5万行".我需要这样,一旦执行了50k行,所有数据都导出后,来自我的c#类的数据库连接将关闭.抱歉造成混乱.
thanks for the response. But my issue is a bit complicated here. The mainform will have other uses for the user while the data is being exported to the database. What I need is: the user puts in "I want 50k rows". I need so that once 50k rows are executed, the database connection from my c# class closes after all the data is exported. Sorry for the confusion.


这篇关于SQL Database C#的通信间隔?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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