Updating a SQL DataSource from the code behind?
I have some code in the front end ASPX page that uses several SQL Datasources to populate several dropdownlists and SELECT values from a SQL database based on the SelectedItem Value. (ie the selected value from dropdownlist1 creates a list to populate dropdownlist2, and then that selected value creates a list for dropdownlist3 - the selected value there becomes the critical value for the rest of the code)
I then use DataView objects in the Code Behind to utilize values from additional database tables to perform calculations based on the critical value above. I also can Save some of the selected values from various database tables to another database.
The problem I am trying to resolve is that when I recall the Saved information and try to re-use the values, I dont know how to re-assign the SQL Datasource SelectedItem to the correct value and have the correct DataSource "re-pull" the required information, so to speak.
Is there anyway to do this without re-creating a bunch of SQL connections in the code behind when it seems that the Datasource objects are readily available and just need to be told to "SELECT" the new information?
This is probably confusing and I'm probably not defining the issue correctly, but I am new at this. Any help would be appreciated.
Thanks in advance.
|