从文本文件复制数据以访问数据库 [英] copy data from text file to access database

查看:92
本文介绍了从文本文件复制数据以访问数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的文本文件:
ID,编号
1,334455
2,454566
3,76434343

我需要将id和number的值复制到访问数据库的2个字段中.
我该如何在C#中做到这一点?

非常感谢.

I have text files like these:
id,number
1,334455
2,454566
3,76434343
etc.
I need to copy the id and number''s values into 2 fields in an access database.
How shall I do that in c#?

Thanks a lot.

推荐答案

1)在MS Acess中创建一个数据库和一个包含2列的表.
2)在C#中打开并读取文本文件.
3)使用ADO.Net,打开一个连接,然后将文本文件中的数据插入数据库表中.
如果您在尝试此操作时遇到任何问题,请将其发布在此处,然后有人会为您提供帮助.
1) Create a database and a table in MS Acess that includes 2 columns.
2) Open and read the text file in C#.
3) Using ADO.Net, open a connection and then insert data from the text file into the database table.

If you run into any issues while trying this, post them here and someone will help you.


这篇关于从文本文件复制数据以访问数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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