用于此目的的Windows应用程序或Web应用程序

用于此目的的Windows应用程序或Web应用程序

问题描述:

I have about 5000 csv file and I want to insert them in a sql server 2008 database.

I don't whether windows application or web application is better.

each csv file is simple a one row with 36 column that will be inserted in an one table in the database.

thanks for your help.

Update 1

This application will be used on a computer that can connect to the database, it is used by the admin just once, in order words, there are people who responsible to write these csv files, then all the files, come to me and I have to insert them in the database

Update 2

Thanks for the user who are trying to help me.

You gave me these options:

  1. bcp

  2. SqlBulkCopy

  3. Windows service

what is the best please? I told you all the requirements, which are very simple.

我有大约5000个csv文件,我想将它们插入到sql server 2008数据库中。 p> \ n

我不知道Windows应用程序或Web应用程序是否更好。 p>

每个csv文件很简单,一行有36列,将插入 数据库中的一个 strong>表。 p>

感谢您的帮助。 p>

更新1 h3>

此应用程序将在可以使用的计算机上使用 连接到数据库,它只被管理员使用一次,顺便说一句,有人负责编写这些csv文件,然后所有文件,来找我,我必须将它们插入数据库 p>

更新2 h3>

感谢想要帮助我的用户。 p>

您给了我以下选项: p>

  1. BCP p> LI>

  2. SqlBulkCopy的 p> LI>

  3. Windows服务 p> li> ol>

    最好的是什么? 我告诉你所有的要求,非常简单。 p> div>

Depends how you want to use it - if you want to deploy to lots of people so they can upload a file and process it into a database, make it web.

If on the other hand, you only have a couple of users which you can easily deploy an app to, there is a lot less infrastructure required to write it as an app.

Sounds to me, you want to automate the mass loading of lots of files, so windows app is jumping out at me.

All depends on what the overall requirements are.

Based on your edit, write a win app that uses a folder enumeration, reads the records and passes to a SqlBulkCopy object.

based on your comment I would take an aproach like that:

Easy to use gui solution: 1. Make a website for people that are making the csv's

  1. That website would preform and check's that are necesery and display any errors. Error checking is done by the Web service (more future proven imo).
  2. Create a webservice importing the file to database and sending you an email. That way you don't have any work with putting the data into the database
  3. Implement an aproveal mechanism so you need to aprove the new inputs to the database if needed

Easy to implement solution:

  1. Create an application (Console/WinForm/Web) that uses the bcp tool to import the data and handles errors