在ms Access中将数据从数组复制到表 [英] copy data from array to table in ms access

查看:110
本文介绍了在ms Access中将数据从数组复制到表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以告诉我是否有可能在ms Access中将数据从数组复制到表中吗?如果可以,怎么办?你能解释一下吗?另外,如果不可能的话,还有一种解决方法,我可以提取数据并将其放在数据库的表中.请有人帮忙.

感谢

can someone please tell me if its possible to copy the data from an array to a table in ms access? If so how?? could you please explain. Also if its not possible is there a way around it in which i can extract the data and put it in a table in database. Please can someone help.

thanks

推荐答案

在开始编程之前,您需要阅读一些文章:
VB中的数组 [ ADO.NET [编辑访问数据库 [为初学者使用ADO.NET [在ADO.NET中使用事务 [开发者社区1号连接字符串参考 [ ^ ]

如何在ms Access中添加数据 [在vb.net中运行访问权限查询 [ ^ ]
ADO.NET代码示例 [用于...下一步 [ ^ ]或插入到 [ ^ ])
---> b)执行命令
3)紧密连接

仅此而已!

PS
将来,您需要更加具体,如果您想获得帮助(正是您想要的).
Before you start programming, you need to read few articles:
Arrays in VB[^]
ADO.NET[^]
Editing an Access Database[^]
Using ADO.NET for beginners[^]
Using Transactions in ADO.NET[^]

Developers community number 1 connection string reference[^]

How to add data in ms Access[^]
Running acccess query in vb.net[^]
ADO.NET Code examples[^]

Scenario:
1) open connection to the database
2) walking through all records in array (using for...next[^] or do...while[^] loop):
--->a) create sql command to insert data into Access table (INSERT INTO[^])
--->b) execute command
3) close connection

That''s all!

PS
In the future you need to be more specific, if you would like to get help (exactly what you want).


在C#.NET中使用DataTable和DataRows类,就可以实现.这是示例代码:

Using DataTable and DataRows classes in C# .NET, you can achieve it. Here is the sample code:

DataTable dt = new DataTable();
dt = dsData.Tables[0].Clone();
DataRows[] drResults = dsData.Tables[0].Select("ColName = 'criteria');

foreach(DataRow dr in drResults)
{
    object[] row = dr.ItemArray;
    dt.Rows.Add(row);
}




您可以使用ODBC连接来连接MS Access DataTable.




You can use ODBC connection to connect MS Access DataTable.


这篇关于在ms Access中将数据从数组复制到表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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