什么是一个列表框显示项目的可能性? [英] What are the possibilities of displaying items in a listbox?

查看:90
本文介绍了什么是一个列表框显示项目的可能性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图找出很长一段时间,现在如何创建一个接口,可以允许用户将数据输入几行并通过所有在一杆的条目到SQL Server数据库。所以我想出了这个(见下图),我不能得到任何更好的想法。

I've been trying to figure out for a long time now how to create an interface that can allows users to input several rows of data and pass those entries into an SQL server database all in one shot. I could not get any better ideas so I came up with this (see picture below).

我设想的是,用户在文本框中输入值,并点击添加到列表按钮。然后将这些值填充在列表框下面标题为展品清单,当附加展览按钮pressed,从列表框中的所有值传递到数据库中。

What I envisioned is that the user enters values in the textboxes and hits the "add to list" button. The values are then populated in the list box below with the heading "exhibits lists" and when the add exhibit button is pressed, all values from the list box are passed into the database.

好吧,我留下再次想知道是否有可能从文本框配合这些值列表框,我是否会能够将它们传递到数据库中。

Well, I'm left wondering again if it would be possible to tie these values from the textboxes to the list box and whether I'd be able to pass them into the database.

如果这是可能的话,我想请很想知道如何去了解它,否则我会很高兴,如果你能推荐一个更好的办法,我处理的情况,否则我不得不解决数据入一在时间

If it were possible then I'd please love to know how to go about it otherwise I'd be glad if you could recommend a better way for me to handle the situation otherwise I'd have to resolve to data entry one at a time.

我相信这是从本网站一些有用的信息,可以帮助解决我的问题,但我不能使文章的正面或反面......好像我几乎没有和它滑了关闭。每个人都可以请阅读并帮助我使它适应我的情况?后下:

I believe there is some useful information from this website that can help solve my problem but I just can't make heads or tails of the article... it seems like I'm almost there and it skids off. Can everyone please read and help me adapt it to my situation? Post below:

HTTP://www.$c$cproject.com/KB/ ASPNET / ExtendedGridView.aspx

推荐答案

是的,这是可能的。我以前做过两次这样。

Yes, it is possible. I have done this twice before.

查看数据访问教程在 http://www.asp.net/web -forms / 的数据的想法。

Check out the "Data Access Tutorials" at http://www.asp.net/web-forms/data for ideas.


  • 对于用户界面,你想有一个数据输入表单数据网格之上。

  • 对于后端,想要一个数据适配器(或表适配器),该负载和在一次操作将数据保存到数据库中。

您会使用的DataSet 的DataAdapter 来更新数据库,并操纵 DataRow的输入和一个数据表的列表框。注意列表框实际上是一个数据网格,中继器或其他控件接受数据表数据源

You would use a DataSet and DataAdapter to update the database, and manipulate a DataRow for the input and a DataTable for the list-box. Note the list-box is actually a data-grid, repeater, or other control that accepts a DataTable as a DataSource.


  • 的DataAdapter 填充的DataSet 包含数据表

输入控件绑定到一个从 DataTable中创建的的DataRow 。当用户点击添加到列表中,您将数据行添加到数据表,然后为下一个项目一个新的数据行。

The input controls bind to a DataRow created from the DataTable. When the user clicks add-to-list, you add the data-row to the data-table, then create a new data-row for the next item.

当用户单击Add-展览,它是使用的DataAdapter 来更新数据库的一个简单的事情。任何更改,删除,并添加数据为您处理。

When the user clicks add-exhibit, it is a simple matter of using the DataAdapter to update the database. Any changed, deleted, and added data is handled for you.

这篇关于什么是一个列表框显示项目的可能性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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