23maploosh
Programmer
I have been reading a book on ASP.net and at a point where they are talking about caching and the sqldatasource. In the book it says that the enablecaching property of the sqldatasource is by default set to false. To test this out I created a simple form with a dropdownlist populated by a sqldatasource (distinct City names from a database table). I also have a gridView that is populated by another sqldatasource. This sqlDataSource uses the City that is selected from the dropdownlist as a select parameter to grab all the employees from the selected city. I have enable caching on the second sqlDatasource (the one filling the gridview). To test this I opened my web form and selected a city (London) which in turn filled my grid view with employees in that city. I then went to sqlserver database table holding the cities and changed one of th city names. When I selected the same (London) the results were the same as before because of the caching. My problem is that the dropdownlist was not updated to show my new city. To try and troubleshoot this I ran a profiler on sqlserver and only saw the application querying one time for the distinct cities. I was under the impression that because I did not turn on caching on my sqldatasource that it would requery the datasource on every postback. Any insight would be appreciated.
Thanks
Matt
Thanks
Matt