|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Query based of a value in a combo boxThe application I'm working on has three tables State, Customer, Orders. In
the first combo box the State is selected. Based on the State selected the second combo box will be populated with the Customers in that state. Based on the Customer selected a datagrid will be populated with the customer's orders. I setup the query for the secont combo box as follows: Select CustName From tblCustomer Where State = @cboState When I run this no records are selected. Any suggestions on what I am missing or forgetting? Thanks... -- Tony Hi,
I would check that you are passing the right value to your query. If your combobox is bound to a datatable the selected item will be a datarowview not the string shown in the combobox. Ken ----------------- Show quoteHide quote "Tony A." wrote: > The application I'm working on has three tables State, Customer, Orders. In > the first combo box the State is selected. Based on the State selected the > second combo box will be populated with the Customers in that state. Based > on the Customer selected a datagrid will be populated with the customer's > orders. > > I setup the query for the secont combo box as follows: > Select CustName From tblCustomer > Where State = @cboState > > When I run this no records are selected. Any suggestions on what I am > missing or forgetting? Thanks... > > -- > Tony Ken,
The combo box is configured as follows: Name: cmbCustName DataSource: TblCustomerBindingSource1 DisplayMember: CustName VauleMember: CustName SelectedItem: TblCustomerBindingSource1 - CustName I declared a variable - Dim varCustNmae as String After the State combo box is changed I have teh following code: varCustName = cboState.SelectedValue -- Show quoteHide quoteTony "Ken Tucker [MVP]" wrote: > Hi, > > I would check that you are passing the right value to your query. > If your combobox is bound to a datatable the selected item will be a > datarowview not the string shown in the combobox. > > Ken > ----------------- > > "Tony A." wrote: > > > The application I'm working on has three tables State, Customer, Orders. In > > the first combo box the State is selected. Based on the State selected the > > second combo box will be populated with the Customers in that state. Based > > on the Customer selected a datagrid will be populated with the customer's > > orders. > > > > I setup the query for the secont combo box as follows: > > Select CustName From tblCustomer > > Where State = @cboState > > > > When I run this no records are selected. Any suggestions on what I am > > missing or forgetting? Thanks... > > > > -- > > Tony
arrghh dot vs comma
How to have a clean exit But what about them hackers? Word automation version problem. Caret Hiding SortCompare of DataGridView - how to? Setting tab stops in RTF control Custom Datagridstyle Help: Control loops & properties in VB .Net 2005 converting a string to it's enum (integer) equivalent |
|||||||||||||||||||||||