如何在可视C#中将数据表绑定到datagridview [英] how to bind datatable to datagridview in visual c#

查看:67
本文介绍了如何在可视C#中将数据表绑定到datagridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
我正在Visual C#中工作
我想将datagridview运行时与datatable绑定
我正在将值从数据库转移到数据表中
而该表我想根据我的要求与datagridview绑定.

当我的自动生成的属性= false时,我想这样做
我该怎么办..
例如.我从数据库到数据表都有胖2 coloum
billno billcharg
现在我想将datagridview显示为
billno,billcharge和金额[这不是数据库的字段].

请给我这个解决方案.....
感谢

hi
i m working with in visual c#
i want to bind the datagridview runtime with the datatable
i m featching the values from database to datatable
and that table i want to bind with datagridview as per my req.

iwant to do this when my autogenerated property=false;

how can i do that..
eg. i have fatch 2 coloum from database to datatable
billno billcharg
and now i want to display the datagridview as
billno ,billcharge and amount [this is not the field of database].

pls give me the solution on this.....
thanks

推荐答案

请参阅示例此处 [ ^ ]了解如何将DataTable 绑定到GridView.
See an example Here[^] to learn how to bind DataTable to a GridView.


这篇关于如何在可视C#中将数据表绑定到datagridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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