I have a problem when using gridview which source is a database VIEWS, not a table.
I have a MySQL database running, ASP web application(C# behind). Then the GridView's source is a combination of 8 views from the database. (
SELECT * FROM v1,v2,v3... v8
Then the problem is when I edit a cell in the GridView and hit Update it changes all the data (sequence numbers) and increment the numbers with one for each view. It's pretty strange result.
Here I have the code behind, the SELECT statement(which should be correct) and the UPDATE statement(where is the problem maybe) :
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:dbcssConnectionString %>" ProviderName="<%$ ConnectionStrings:dbcssConnectionString.ProviderName %>" SelectCommand="select * from vv1, vv2, vv3, vv4, vv5, vv6, vv7, vv8 where vv1.pad = vv2.pad AND vv2.pad = vv3.pad AND vv3.pad = vv4.pad AND vv4.pad = vv5.pad AND vv5.pad = vv6.pad AND vv6.pad = vv7.pad AND vv7.pad = vv8.pad;" UpdateCommand="UPDATE vv1, vv2, vv3, vv4, vv5, vv6, vv7, vv8 SET Lift1 = @lift1, Lift2 = @lift2, Lift3 = @lift3, Task4 = @task4, Task5 = @task5, Task6 = @task6, Task7 = @task7, Task8 = @task8 WHERE ???"> </asp:SqlDataSource>
I know that I didn't completed the UPDATE command but I think the problem is coming from the WHERE clauses in either of the commands.
Hope you can understand me and give me directions
Thanks a lot in advance