Hi ,
I have used a radgrid for selecting and displaying the data from SQL DB. I got stuck up at this point with the below problem:
1) I am retrieving the data from DB using selectcommand in .aspx page.
2) I am updating the same using above query in .aspx page.
The user can edit a field of the table/grid by clicking on the edit button. As it can be seen in the update querry above, the ETA and the Comment fields are editable and once the changes are done , the update button is clicked.
After this the table should be refreshed with the new changes which have just been incorporated by the user. The issue arises when the update button is clicked.
The changed data is being fetched from the DB but the, ETA and comments fields in each row of the new table generated, now contain the changed/updated values.
This is because we are unable to identify the row which has been changed, with a unique ID.
I would like to know,how to identify a row uniquely in a given update querry in aspx.
Kindly refer to the "?????????" in the query posted above in .aspx.
I would like to know how to extract a given field of a radgrid. For instance, the background id associated with "Print" , which is the value in the first row, first column of the grid. (please refer the screenshot attached) .
This value/unique id, should now be substituted for the "??????" in the above querry.
I have used a radgrid for selecting and displaying the data from SQL DB. I got stuck up at this point with the below problem:
1) I am retrieving the data from DB using selectcommand in .aspx page.
<asp:SqlDataSource ID="SqlDataSource1" runat="server" |
ConnectionString="<%$ ConnectionStrings:TestMangerConnectionString %>" |
SelectCommand="SELECT Component_Table.Component as Component,Bug_Count_Bucket_Wise.E2ECount_Total as Total,Bug_Count_Bucket_Wise.E2ECount_Active as Active,Bug_Count_Bucket_Wise.E2ECount_Closed as Fixed,Bug_Count_Bucket_Wise.E2ECount_Resolved as Resolved,Track_Table.ETA as ETA,Track_Table.Comments as Comments |
FROM Bug_Count_Bucket_Wise,Component_Table,Track_Table,Type_of_Bucket,TL_Details,TM_Details |
WHERE |
Component_Table.CompID=Bug_Count_Bucket_Wise.CompID |
AND Bug_Count_Bucket_Wise.CompID=Track_Table.CompID |
AND TM_Details.TMID = TL_Details.TMID |
AND TL_Details.ID=Component_Table.TLID |
AND Type_of_Bucket.ID = Track_Table.BucketID |
AND TM_Details.TMAlias=@TM |
AND Type_of_Bucket.Type= 'AHI'" |
UpdateCommand="UPDATE Track_Table |
SET Track_Table.ETA = @ETA,Track_Table.Comments= @comments,Track_Table.Modified_Date= @CurrentTime,Track_Table.Edit_Alias=@LoginUser |
FROM Bug_Count_Bucket_Wise,Component_Table,Track_Table,Type_of_Bucket,TL_Details,TM_Details |
WHERE |
Component_Table.CompID=Bug_Count_Bucket_Wise.CompID |
AND Bug_Count_Bucket_Wise.CompID=Track_Table.CompID |
AND TM_Details.TMID = TL_Details.TMID |
AND TL_Details.ID=Component_Table.TLID |
AND Type_of_Bucket.ID = Track_Table.BucketID |
AND TM_Details.TMAlias=@TM |
AND Type_of_Bucket.Type= 'AHI' |
AND Component_Table.Component = ??????"> |
<SelectParameters> |
<asp:CookieParameter CookieName="TM" Name="TM" Type="String" DbType="Object" /> |
</SelectParameters> |
<UpdateParameters> |
<asp:Parameter Name="ETA" Type="DateTime" /> |
<asp:Parameter Name="Comments" Type="String" /> |
<asp:CookieParameter CookieName="CurrentTime" Name="CurrentTime" Type="DateTime" DbType="Object" /> |
<asp:CookieParameter CookieName="LoginUser" Name="LoginUser" Type="String" DbType="Object" /> |
<asp:CookieParameter CookieName="TM" Name="TM" Type="String" DbType="Object" /> |
<asp:Parameter Name="Component" Type="String" /> |
</UpdateParameters> |
</asp:SqlDataSource> |
2) I am updating the same using above query in .aspx page.
The user can edit a field of the table/grid by clicking on the edit button. As it can be seen in the update querry above, the ETA and the Comment fields are editable and once the changes are done , the update button is clicked.
After this the table should be refreshed with the new changes which have just been incorporated by the user. The issue arises when the update button is clicked.
The changed data is being fetched from the DB but the, ETA and comments fields in each row of the new table generated, now contain the changed/updated values.
This is because we are unable to identify the row which has been changed, with a unique ID.
I would like to know,how to identify a row uniquely in a given update querry in aspx.
Kindly refer to the "?????????" in the query posted above in .aspx.
I would like to know how to extract a given field of a radgrid. For instance, the background id associated with "Print" , which is the value in the first row, first column of the grid. (please refer the screenshot attached) .
This value/unique id, should now be substituted for the "??????" in the above querry.