ComboBox в VB 2008

Форум посвящён работе с базами данных в .NET.

Модератор: Ramzes

sbb1972
Начинающий
Начинающий
 
Сообщения: 1
Зарегистрирован: 30.01.2009 (Пт) 1:32

ComboBox в VB 2008

Сообщение sbb1972 » 30.01.2009 (Пт) 1:44

Есть две таблицы "Продажи" с полями IdТовар , Количество, цена, сумма
И таблица "Товары" с полями Id, название
Как можно в форме заполняя таблицу "продажи" пункт idТовар выбирать ComboBox -ом из таблицы "Товары"
В VB 6 Был специальный элемент, где можно было указать источник строк, а вот в VB 2008 Я не нашел (((
И второй вопрос можно подключить такой же выбор в Gride.
Конечно всё можно решить и с помощью кода, но как я думаю, есть и более простые решения.
Подскажите где прочитать.

Ramzes
Скромный человек
Скромный человек
Аватара пользователя
 
Сообщения: 5004
Зарегистрирован: 12.04.2003 (Сб) 11:59
Откуда: Из гробницы :)

Re: ComboBox в VB 2008

Сообщение Ramzes » 03.02.2009 (Вт) 22:40

Public Property DataSource() As Object
Member of System.Windows.Forms.ComboBox

Summary:
Gets or sets the data source for this System.Windows.Forms.ComboBox.

Return Values:
An object that implements the System.Collections.IList interface, such as a System.Data.DataSet or an System.Array. The default is null.

Public Property ValueMember() As String
Member of System.Windows.Forms.ListControl

Summary:
Gets or sets the property to use as the actual value for the items in the System.Windows.Forms.ListControl.

Return Values:
A System.String representing the name of an object property that is contained in the collection specified by the System.Windows.Forms.ListControl.DataSource property. The default is an empty string ("").

Exceptions:
System.ArgumentException: The specified property cannot be found on the object specified by the System.Windows.Forms.ListControl.DataSource property.

Public Property DisplayMember() As String
Member of System.Windows.Forms.ListControl

Summary:
Gets or sets the property to display for this System.Windows.Forms.ListControl.

Return Values:
A System.String specifying the name of an object property that is contained in the collection specified by the System.Windows.Forms.ListControl.DataSource property. The default is an empty string ("").


А еще, у DataTable есть замечательный метод :
Public Function [Select](ByVal filterExpression As String) As System.Data.DataRow( )
Member of System.Data.DataTable

Summary:
Gets an array of all System.Data.DataRow objects that match the filter criteria in order of primary key (or lacking one, order of addition.)

Parameters:
filterExpression: The criteria to use to filter the rows.

Return Values:
An array of System.Data.DataRow objects.


и вообще, тему надо бы в ADO.NET перенести :?


Вернуться в ADO.NET

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 7

    TopList