如何在多列中插入列表框项但在单行中? [英] How to insert listbox items in multiple columns but in single row?

查看:83
本文介绍了如何在多列中插入列表框项但在单行中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将列表框项添加到数据库表中。但我想根据条件将这些列表框项添加到单行的不同列中。怎么办?

任何帮助表示赞赏。



我的尝试:



我将所有这些列表框项添加到数据表中,并创建了用户定义的数据表类型来插入这些值。

我在这里做了。我不知道接下来要做什么

解决方案

如果要使用多列数据,请不要使用ListBox,而是使用ListView。



这是它的文档... ListView类(System.Windows.Forms) [ ^ ]



您将需要使用详细信息视图



以下是一个示例: C#ListView控件 [ ^ ]

I want to add listbox items to a database table. But I want to add those listbox items to different columns in a single row based on the condition. How to do?
Any help is appreciated.

What I have tried:

I added all those listbox items to a datatable and I created userdefined datatable type to insert those values.
I did upto here. I don't what to do next

解决方案

If you want to use multiple columns of data don't use a ListBox, use a ListView instead.

Here is the documentation for it ... ListView Class (System.Windows.Forms)[^]

You will want to use the "Details" view

Here is an example: C# ListView Control[^]


这篇关于如何在多列中插入列表框项但在单行中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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