根据CSV文件的更改更新sql表 [英] Update sql table based on the changes of a CSV file

查看:290
本文介绍了根据CSV文件的更改更新sql表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我真的是这个概念的新手。这是我的第一个问题。我有点了解programmin的基础知识,我仍然是SQL的新手。

好​​的,

现在我的问题是。我如何根据每20秒发生的变化更新表上的值,例如在由另一个C#执行程序控制的CSV文件中。



如果我还没有制作我很清楚。请告诉我



谢谢。

Hello guys,
I am really newbie to this concept. It is really my first question. I kinda know the basics about programmin still i am very new to SQL.
Ok,
now my question is. How may i update the values on a Table based on the changes that happen every 20sec for example in an CSV file controled by an other C# executive.

If i havent made myself clear. Please tell me so

Thank you.

推荐答案

我想你可以实现一个运行的服务你的服务器





演练:创建Windows服务应用程序
[ ^ ]



(您还可以创建一个简单的控制台应用程序来执行相同操作工作)



那么你可以使用FileSystemWatcher

FileSystemWatcher类 [ ^ ]



但是,有一些陷阱。



FileSystemWatcher - Pure Chaos(第1部分,共2部分) [ ^ ]



一个简单的方法是使用一个计时器每隔20秒触发一次,并调用一个方法来检查是否有可用的文件。

计时器类 [ ^ ]



无论哪种方式,您都必须决定是否应该删除处理后的文件,将其移动到另一个文件夹等。



我希望这些链接可以帮助你。
I guess you could implement a Service that runs on your server


Walkthrough: Creating a Windows Service Application
[^]

(You can also create a simple console application that does the same job)

Then you can use the FileSystemWatcher
FileSystemWatcher Class[^]

However, there are some pitfalls.

FileSystemWatcher - Pure Chaos (Part 1 of 2)[^]

A simple way is to use a timer that fires every 20 seconds and calls a method that checks if there are any files available.
Timer Class[^]

Either way you have to decide if you should delete the file after processing, move it to another folder, etc.

I hope these links will help you along.


这篇关于根据CSV文件的更改更新sql表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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