Search & loading a BindedControl
Good morning,
I am working in Visual Studio, I have Binded some controls in the designer and I am trying to get sorted results to load on my form.
Code:
Tbl_InstitutionsTableAdapter.Fill(Me.BudgetDataSet.tbl_Institutions)
Tbl_InstitutionsBindingSource.DataSource = BudgetDataSet.tbl_Institutions
I have this and it loads the first item in the Access database, but I want to be able to search the database and then load the result.
What am I missing here?
Richard
Re: Search & loading a BindedControl
Quote:
What am I missing here?
Mostly a better description of your problem. What is not happening? What is the "item" in which you are referring? You want to search the database before loading the rows? What controls?
Re: Search & loading a BindedControl
Quote:
Originally Posted by
kpmc
Mostly a better description of your problem. What is not happening? What is the "item" in which you are referring? You want to search the database before loading the rows? What controls?
I have my controls bound on the winform through the designer.
With the method noted above, the Binded controls fill, but only with the information from the first row in the table.
I pass a variable from one form to another form and when the second form loads, the controls fill with information, but regardless of which variable I pass, I always get the first row in the table.
I pass the first "search term", I get the data for the first row loaded in the controls, I pass the second "search term" and I get the data from the first item loaded in the controls, and so forth....
I am trying to figure out how to search and load what I want loaded.
I hope this helps.
Richard
Re: Search & loading a BindedControl
Quote:
I have my controls bound on the winform through the designer.
I should probably learn that I simply can't help in situation where Mr. Wizard is writing code.
Quote:
With the method noted above, the Binded controls fill, but only with the information from the first row in the table.
I will just guess which controls in which you're referring. I suppose textbox, datagridview, maybe a combobox here and there...
Quote:
I pass a variable from one form to another form and when the second form loads, the controls fill with information, but regardless of which variable I pass, I always get the first row in the table.
Showing us how you pass this would probably help. Is it used a parameter? Is this variable the "Search Term" you're referring to?
Quote:
I am trying to figure out how to search and load what I want loaded.
You either need to adjust your SQL Statement and supply a WHERE clause to whichever column/value you want to alter, or change the position of the bindingsource to the row you wish to enter.
Doing this by designer is something I have no experience with, but I assume there should be options on the dataset to change the SQL params. Sorry I dont have more insight to what youre trying.