1
Hello, I have a C# application using Windows Forms
My question would be as follows. I have a database made in Access It contains 2 tables, a table called State, which contains Code and State and another table called Cities, which contains Code, State and City.
Remembering that I have 2 combobox, the first combobox is filled with the data of the state table, using bindingsource, until then everything is right, it appears all the codes of state. The doubt I have would be the following, I wanted to make a relationship between the combobox 1 and 2, and the 2 will show all cities, according to the selected state, but in bindingsource, there is no filtering option, and I am doubtful how to put this.
Using a bank search will exit this method:
SELECT Cidade FROM Cidades WHERE Estado='" + sel_UF + "'
I read some topics also on the internet and some right here in stackoverflow, but I could not resolve my doubt, in which talks to put something related within the event:
SelectedValueChanged
If anyone can give me a light there, I’d appreciate it
I still did not understand, not to mention that your example is in Asp.net, I need something in c# same, for windows form application, and the way that this might not work, because in the bank has all cities and state already, just he knows to select which one he wants
– SNOT
Which part you don’t understand?
– PauloHDSousa
the concept may even be similar, but in the code declaration is different from Asp to c#
– SNOT
Just use the right event that works.
– PauloHDSousa