-
December 9th, 2005, 01:49 AM
#1
Combo Box
Hello to all
I am working on an inventory system with Sql server and VB.net
I enter the Items Like pencil, pen, notepad in Items names and they get saved in the database..
Now i am using anyother form where in the combo box these items should be shown....
I wana to fill the list of items like pencil, pen in the combo Boxx
How will i implemet this in my code using sql server....
q.Add("Item_Date", cmbDatepurchase.Value.ToString())
q.Add("Item_RecepitNo", txtRecpno.Text.ToString())
q.Add("Item_OrderNo", txtOrderno1.Text.ToString())
q.Add("Item_id", cmbItemid.Value.ToString())
q.Add("Item_Des1", txtDescriptionitem.Text.ToString())
q.Add("Item_Quantity", txtQuantityitem.Text.ToString())
q.Add("Item_Price", txtPriceitem.Text.ToString())
q.Add("Item_ReceivedBy", cmbRecvby1.Text.ToString())
Dim SQL As String = SQL_Methods.SqlQuery_Insert("tblItems", q)
oConnect.ExecUpdate(SQL)
MessageBox.Show("Item saved")
This it the code
when i select the Item cobmo box all items should be shown.. what will be the code
How I will make use of combo BOx... Plz anyone help me in this regard
faiza
-
December 9th, 2005, 02:14 AM
#2
Re: Combo Box
Originally Posted by faiza046
when i select the Item cobmo box all items should be shown.. what will be the code
How I will make use of combo BOx... Plz anyone help me in this regard
If I understand you correctly, you want to know how to use the combobox ¿
You could perhaps look at the SelectedIndexChanged event
-
December 9th, 2005, 07:46 AM
#3
Re: Combo Box
I don't understand what the relevance of the code you have posted to the ComboBox issue is.
A combobox can be filled with data from a DataTable:
Code:
MyComboBox.DataSource = yourDataTableObject
MyComboBox.DisplayMember = "Name" 'The name of the column with the text to show
MyComboBox.ValueMember = "ID" 'The name of the column with the value
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|