Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi everyone,

I need your help.

So, here it is a short description from what i want do do.

I have a gridview that is linked to an sqldatasource.
In the page load I get values (rows) from the sqldatasource to an dataview because i want to calculate a value and then show it to the users, i have to calculate this value for every row in the datasource/dataview.

My problem is: there is a way to update sqldatasource with a dataview?

Thanks in advice.

Cheers!
Posted
Comments
ZurdoDev 29-Oct-13 7:29am    
Update how? What do you mean?
calmeidaff 29-Oct-13 7:54am    
Through code, i calculated values that i want to show to the users.
But i stored them in a dataview, in a specific column that came up blank from sqldatasource.

After calculating this values and store then in the dataview, i want to know if a can update the sqldatasource with the new values from the dataview.

And why?

My real problem isn't bind the dataview to the gridview. The problem is if I have an sqldatasource feeding my gridview, the sorting is almost automatic.
But with the dataview it does not work. And I can't able to do it. I searched how to do it but nothing. I can't make it. :(

Thank you for your reply.
ZurdoDev 29-Oct-13 7:58am    
I still don't fully understand. Just write code to update the database and then rebind your sqldatasource.
calmeidaff 29-Oct-13 8:10am    
In practical terms, what i want to do is something like this at the end of my routine:

sqldatasource = dataview (basically is refreshing the datasource with the new values that are store in the dataview)

gridview.datasource = sqldatasource
gridview.databind()

I'm not shure if is possible to do it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900