|
-
Nov 29th, 2017, 09:42 AM
#1
Thread Starter
Junior Member
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
-
Nov 29th, 2017, 11:18 AM
#2
Re: Search & loading a BindedControl
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?
-
Nov 29th, 2017, 11:35 AM
#3
Thread Starter
Junior Member
Re: Search & loading a BindedControl
 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
-
Nov 29th, 2017, 11:55 AM
#4
Re: Search & loading a BindedControl
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.
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...
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?
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.
Tags for this Thread
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
|