创建一个列表并将其绑定到DataTable(在c#中) [英] Create a List and Bind it to a DataTable(in c#)

查看:83
本文介绍了创建一个列表并将其绑定到DataTable(在c#中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好
如何创建列表并将其绑定到DataTable?

首先我必须创建一个列表



List< datatable> My_list = new List< datatable>();

1-如何创建列表(按表格格式)?





然后包含DataTable必须绑定到此列表。



My_list = Bind_DataTable_to_List_function()

2-怎么能我创建了这个函数吗?



非常感谢

Hi How can I Create a List and Bind it to a DataTable?
In the first I must create a list

List<datatable> My_list = new List<datatable>();
1- How a list (by table format) could be created?


Then contains of DataTable must be bind to this list.

My_list = Bind_DataTable_to_List_function()
2- How can I create this function?

Thanks very much

推荐答案

你没有把任何东西绑定到DataTable 。相反,您将List和DataTable对象绑定到可显示的控件,例如DataGridView或ListView。
You don't bind anything to a DataTable. Instead, you bind List and DataTable objects to displayable controls, such as DataGridView, or ListView.


如果您要求将Datatable转换为List,以下文章将会有所帮助。



http:// codenicely。 blogspot.in/2012/02/converting-your-datatable-into-list.html [ ^ ]
If you are asking about converting Datatable into List, following article will be helpful.

http://codenicely.blogspot.in/2012/02/converting-your-datatable-into-list.html[^]


这篇关于创建一个列表并将其绑定到DataTable(在c#中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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