如何查询SQL Server以及其他2个Access数据库并获取csv导出的数据? [英] How do I query SQL server plus 2 other Access Databases and grab the data for a csv export?
本文介绍了如何查询SQL Server以及其他2个Access数据库并获取csv导出的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有3个2D阵列,包含3个来源的数据 - 一个SQl服务器和2个Access数据库。我需要将数据与3个阵列中的公共ID相关联,并将数据导出到csv文件中。我可以导出3个文件,但是一个文件会更聪明。
这可能吗?
应该我将数据存储在另一个对象中?
有更好的方法吗?
谢谢
解决方案
将您的信息读入DataTables然后处理这些信息。
类似的问题被提出这里 [ ^并且其中一个响应者已经提供了一个功能,可以根据共享的id字段将多个数据表合并为一个。
至于将其转换为CSV文件查看这些CP文章
将DataTable写入CSV文件 [ ^ ]
和
将数据表导出为.csv格式的最简单代码 [ ^ ]
I have 3 - 2D arrays with data from 3 sources - one SQl Server and 2 Access databases. I need to link the data with a common ID found in the 3 arrays and export the data into a csv file. I could export 3 files, but one file would be smarter.
Is this possible?
Should I store the data in another object?
Is there a better approach?
Thanks
解决方案
Read your information into DataTables then process those.
A similar question was asked here[^] and one of the responders has provided a function to merge multiple datatables into one, based on a shared id field.
As for getting it out into a CSV file have a look at these CP articles
Writing a DataTable to a CSV file[^]
and
Simplest code to export a datatable into .csv format[^]
这篇关于如何查询SQL Server以及其他2个Access数据库并获取csv导出的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文