在VB.net中的数据网格中显示数组数据 [英] displaying Array data in a Data Grid in VB.net

查看:172
本文介绍了在VB.net中的数据网格中显示数组数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在vb.net中以数据网格形式显示数组


数组已从csv导入,因此每个数组项都是[日期,时间,标志]但我可以根据需要拆分或加入以更改数组的格式。


我希望日期,时间和标志是单独的列和每个数组项目是一个新行。


我不知道从哪里开始这个问题。我查看了msdn网站并做了一些谷歌搜索无济于事。如果有人能指出我比我找到的更好的资源,我们将非常感激。


干杯

I''m trying to get an array to display in a data grid form in vb.net

The array has been imported from a csv, such that every array item is [date,time,flag] but I can split or join as needed to change the format of the array.

I want date, time, and flag to be seperate columns and each array item to be a new row.

I don''t know where to start with this problem. I have looked through the msdn website and done some googling to no avail. If someone can point me to some better resources than I''ve been finding, it would be much appreciated.

Cheers

推荐答案


我正在尝试在vb.net中以数据网格形式显示数组


数组有已经从csv导入,这样每个数组项都是[日期,时间,标志],但我可以根据需要拆分或加入以更改数组的格式。


我想要日期,时间和标志是单独的列,每个数组项是一个新行。


我不知道从哪里开始这个问题。我查看了msdn网站并做了一些谷歌搜索无济于事。如果有人能指出我比我找到的更好的资源,我将不胜感激。


干杯
I''m trying to get an array to display in a data grid form in vb.net

The array has been imported from a csv, such that every array item is [date,time,flag] but I can split or join as needed to change the format of the array.

I want date, time, and flag to be seperate columns and each array item to be a new row.

I don''t know where to start with this problem. I have looked through the msdn website and done some googling to no avail. If someone can point me to some better resources than I''ve been finding, it would be much appreciated.

Cheers





我有想法实现,试试我不确定这可能是一个正确的解决方案,

这里是..

1.首先根据数组结构创建一个包含行和列的数据表,2。使用foreach循环,将数组项写入此数据表,然后将此数据表绑定到gridview。


尝试之后让我知道它的工作与否......


谢谢

Saran

Hi,
I have an idea to implement , Just try Im not sure this might be a correct solution,
here goes..
1.First create a datatable with rows and columns based on the array structure, 2.using a foreach loop, write the array items to this datatable,
3. Then bind this datatable to the gridview.

After trying this Let me know It works or not....

Thanks
Saran


谢谢。


我的程序是一个用于测量的笔记程序,所以我试图让它超级健壮。持有数据的数组,每次打开文本文件时都会重新打开文本文件,并在每次更改后恢复它。为了进行强有力的尝试,我试图完全避免使用数据库进行存储。也许如果它只是一个中间步骤,它不是一个大问题,但如果我可以从数组直接进入数据库,它肯定会省一步。
Thanks.

My program is a notetaking program for surveying, so I''m trying to make it super robust. The array that is holding the data, reopens the text file each time it''s going to do soemthing to it and restores it after every change it makes. Towards the robust attempt, I''m trying to avoid using a database for storage altogether. Perhaps if it''s just an intermediary step, It''s not such a big deal, but if I could go straight from an array into the data base, It would definitely save a step.


DataTable是内存中的一个对象,不需要数据库。
DataTable is an object in memory, no need for a database.


这篇关于在VB.net中的数据网格中显示数组数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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