| | |
Please help with parameters for queries
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2006
Posts: 23
Reputation:
Solved Threads: 1
Hi
I'm currently using data binding, combo boxes, grids...
I need to filter the data in a DataGridview depending on a value selected in a combo box. The combo is bound to a table, displaying data from a particular column, while the datagrid needs to "query" a second table "...WHERE condition = <combo value>".
If I add a parameter in the query a text box appears on my form. Is there a way to pass the value returned by the combo as a parameter for the datagrid query ?
Or perhaps another way to work with data without recordsets?
I'm currently using data binding, combo boxes, grids...
I need to filter the data in a DataGridview depending on a value selected in a combo box. The combo is bound to a table, displaying data from a particular column, while the datagrid needs to "query" a second table "...WHERE condition = <combo value>".
If I add a parameter in the query a text box appears on my form. Is there a way to pass the value returned by the combo as a parameter for the datagrid query ?
Or perhaps another way to work with data without recordsets?
•
•
Join Date: Jul 2006
Posts: 23
Reputation:
Solved Threads: 1
Never mind, i got it done.
I set a parameter in the query. VB automatically adds a toolstrip with a box for the @param1. I used a text box for @param1
Now I set the same for the text box:
that len check is for a live filter
I set a parameter in the query. VB automatically adds a toolstrip with a box for the @param1. I used a text box for @param1
VB.NET Syntax (Toggle Plain Text)
Private Sub FillBy_textToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FillBy_textToolStripButton.Click Try Me.Tbl_ERP_PRODUCTION_ORDERSTableAdapter.FillBy_text(Me.SITEQDataSet.tbl_ERP_PRODUCTION_ORDERS, TextToolStripTextBox.Text) Catch ex As System.Exception System.Windows.Forms.MessageBox.Show(ex.Message) End Try End Sub
Now I set the same for the text box:
Private Sub txtOrder_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtOrder.TextChanged If txtOrder.TextLength < 4 Then Exit Sub Try Me.Tbl_ERP_PRODUCTION_ORDERSTableAdapter.FillBy_text(Me.SITEQDataSet.tbl_ERP_PRODUCTION_ORDERS, txtOrder.Text) Catch ex As System.Exception System.Windows.Forms.MessageBox.Show(ex.Message) End Try End Sub
that len check is for a live filter
![]() |
Similar Threads
- sql query problem with MS Access and C# (C#)
- Updated : Simple ASP.Net Login Page (ASP.NET)
- KSH Passing parameters that start with $ (Shell Scripting)
- query with combo box input (MS Access and FileMaker Pro)
- Drop Downlist Not Loading (VB.NET)
- Need Help Creating a Search Page (ColdFusion)
- Computer extremely slow - can you please help tell me what's wrong? (Viruses, Spyware and other Nasties)
- MySQL Maestro (Computer Science)
Other Threads in the VB.NET Forum
- Previous Thread: AutoCads .net api for VB.net
- Next Thread: vb6 to vb.net with ADO
| Thread Tools | Search this Thread |
"crystal .net .net2005 2008 access add advanced application array assignment basic beginner box button buttons center click code combo convert cpu cuesent data database datagrid datagridview designer dissertation dissertations dissertationthesis dosconsolevb.net editvb.net employees excel exists firewall forms html image images isnumericfuntioncall listview login map math memory mobile module msaccess mssqlbackend mysql navigate net number opacity open pan pdf picturebox picturebox2 port print printpreview record regex reports" reuse right-to-left save savedialog search serial socket sorting sqldatbase sqlserver storedprocedure string temp textbox timer txttoxmlconverter upload useraccounts usercontol usercontrol vb vb.net vb.nettoolboxvisualbasic2008sidebar vba vbnet vista visual visualbasic visualbasic.net visualstudio.net web wpf wrapingcode xml





