Data source SQL query

In my gridview, after doing an insert operation, I am filtering the sqldatasource by ID. I am getting the error that the selected value of the dropdown item is not in the list. To test my theory, I created a new sql datasource with only select statement, and after the insert operation, I bind it to grid view and filter by id and I get my result.

Having a second data source is not a solution, so is it possible to somehow use sqldatasource1? what i have tried is sqldatasource.databind () and gridview.databind () for inserted and injected metheds in many test cases, but still it doesn't work.

I don't have filters applied to the original data source?

+2


a source to share


1 answer


Code is better, but if you load your datasource from code you can try something like this after it inserts or does whatever it needs:

gridview.datasource = [class or function that returns datasource];
gridview.databind();

      



and that should repopulate your details.

0


a source







All Articles