How to update MYSQL Database with data from Excel using ASP.NET?

非 Y 不嫁゛ 提交于 2019-12-24 08:24:45

问题


I have an excel file which gets updated every 10 seconds through an automated process. I need excel data to be updated in MY-SQL database which is located on a remote server.

How do I do that?

I have thought of following option: 1) Every 11 seconds, an Excel macro will run and will "Save as" excel as CSV file. (not sure whether this can be done by macro...just thinking) 2) This CSV file we will FTP to remote server using Windows Service. 3) On remote server, we will parse the csv file and Update MYSQL database.

Is this approach fine? Or do you have a better approach which requires less time to update the database?

Thanks!


回答1:


I found following links to be more useful:

http://www.heritage-tech.net/908/inserting-data-into-mysql-from-excel-using-vba/

http://vbaexcel.eu/vba-macro-code/update-mysql-database-php

I hope this helps someone having similar problem as mine.




回答2:


You can connect to the Excel spreadsheet using ODBC connection, read the data, and post it to the MySQL database, maybe through some sort of web service access, or via a saved CSV file?



来源:https://stackoverflow.com/questions/5189930/how-to-update-mysql-database-with-data-from-excel-using-asp-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!