Click here to Skip to main content
12,557,906 members (50,072 online)
Rate this:
Please Sign up or sign in to vote.
See more: ASP.NET MySQL
<asp:GridView ID="grdcareplan" runat="server" CellPadding="5" CssClass="CustomGrid" ShowFooter="True"
 AutoGenerateColumns="False" GridLines="Horizontal" AllowPaging="True"  DataKeyNames="ParameterId"
        Width="950px" onselectedindexchanged="grdcareplan_SelectedIndexChanged1" 
        onpageindexchanging="grdcareplan_PageIndexChanging" Height="16px" 
        style="margin-right: 0px" onrowediting="grdcareplan_RowEditing" onrowcancelingedit="grdcareplan_RowCancelingEdit" 
        EmptyDataText="No Record found for this Item">
                            <asp:CommandField EditText="<img src='images/HMS Buttons/edit_icon.png'>" ShowEditButton="true" UpdateText="<img src='images/HMS Buttons/edit_icon.png'>" />
                             <itemstyle cssclass="w" />
                                        <asp:ImageButton ID="Imgbtnsave" runat="server" 
                                            ImageUrl="~/images/HMS Buttons/LaunchIcon.png" CssClass="icon" 
                              <asp:BoundField DataField="ParameterName" HeaderText="Scheduled Items" 
                                    ReadOnly="True" />
                              <asp:TemplateField HeaderText="Target Value">
                                        <asp:Label ID="Label6" runat="server" Text='<%# Bind("Target_Value") %>'>
                                        <asp:TextBox ID="txttargetvalue" runat="server" 
                                            Text='<%# Bind("Target_Value") %>' CssClass="textboxInGrid">

This is my procedure..which i tried..but it is not working
DROP PROCEDURE IF EXISTS hms.Select_LastDate_Result;
CREATE PROCEDURE hms.`Select_LastDate_Result`()
      SELECT top(1)Last_Date, Result
        FROM patient_progress_tracking_details
       WHERE (SELECT top(1) Current_Test_Date, Test_Result
                FROM patient_progress_tracking_details
              ORDER BY Current_Test_Date, Test_Result DESC);
This is my grid ...on save Image button click,I want to take value from Current_Test_Date and Test_Result and that should be displayed in Last_Date and Result,What Will be the procedure for that...
Posted 4-Jan-13 19:23pm
Updated 4-Jan-13 20:36pm
jibesh 6-Jan-13 3:54am
"it is not working" can be for any reason. can you please provide some sample data with records.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Try this

SELECT top 1 Current_Test_Date as Last_Date, Test_Result as Result
FROM patient_progress_tracking_details (NOLOCK)
ORDER BY Current_Test_Date, Test_Result DESC

Accept Answer if it helps you :)

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.161026.1 | Last Updated 7 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100