使用VB.NET设计模板 [英] designing template using VB.NET

查看:89
本文介绍了使用VB.NET设计模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我想在左侧创建一个包含数据库及其内容(字段)的工作表或实用工具(比如一节)...我想让用户选择字段...和datagridview应填充相应的字段...请帮助我..提前谢谢...

Hi everyone,I want to create a sheet or utilty that contains database and it's contents(fields) on left hand side(say a section)...i want to give the facility to user to choose the fields...and datagridview should be populated with respected field...please help me out..thanks in advance...

推荐答案

为此您可以使用 Master Detail relationsh ip显示数据。



您所说的左侧字段将存储在一个数据表中比如说订单(在Microwind的Northwind示例数据库中找到)作为行。创建另一个DataTable说订单明细来存储要在右侧显示的数据。使用主键和外键值在这些表之间建立 DataRelation 。说两个表中都有 OrderId 列,然后可以在这些列之间建立DataRelation。 Orders DataTable的每一行都与Order_Details中的行有关。



请参阅以下文章

通用目的类从DataBase填充DataTable并将DataTable保存到DataBase使用反射 [ ^ ]

在演示程序中,在第二个标签页,订单和订单详细信息下,您可以找到类似的功能。这篇文章是在C#中,但您可以使用在线转换器将代码转换为VB.NET

http:// converter。 telerik.com/ [ ^ ]
For this purpose you can use Master Detail relationship to display the data.

The left hand side fields you have said are to be stored in one data table say Orders (as found in Northwind sample database of MicroSoft) as rows. Create another DataTable say Order Details to store the data to be displayed on the right hand side. Establish a DataRelation between these table using the Primary Key and Foreign Key values. Say OrderId column is present in both the tables, then the DataRelation can be established between these columns. Each row of Orders DataTable has relation to the rows in Order_Details.

Please see the following article
General purpose class to fill DataTable(s) from DataBase and to save DataTable(s) to DataBase using reflection[^]
In demo program, under second tab page, Order and Order details, you can find a similar functionality. The article is in C# but you can convert the code to VB.NET using the online converter
http://converter.telerik.com/[^]

这篇关于使用VB.NET设计模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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