Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NETMySQL
<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" 
        onrowupdating="grdcareplan_RowUpdating" 
        onrowdeleting="grdcareplan_RowDeleting" 
        EmptyDataText="No Record found for this Item">
                            <columns>
                            <asp:CommandField EditText="<img src='images/HMS Buttons/edit_icon.png'>" ShowEditButton="true" UpdateText="<img src='images/HMS Buttons/edit_icon.png'>" />
                             <asp:TemplateField>
                             <itemstyle cssclass="w" />
                               <itemtemplate>
                                        <asp:ImageButton ID="Imgbtnsave" runat="server" 
                                            ImageUrl="~/images/HMS Buttons/LaunchIcon.png" CssClass="icon" 
                                            onclick="Imgbtnsave_Click"/>
                                        </itemtemplate>
                             
                               
                              <asp:BoundField DataField="ParameterName" HeaderText="Scheduled Items" 
                                    ReadOnly="True" />
                              <asp:TemplateField HeaderText="Target Value">
                                   
                                    <itemtemplate>
                                        <asp:Label ID="Label6" runat="server" Text='<%# Bind("Target_Value") %>'>
                                    </itemtemplate>
                                     <edititemtemplate>
                                        <asp:TextBox ID="txttargetvalue" runat="server" 
                                            Text='<%# Bind("Target_Value") %>' CssClass="textboxInGrid">
                                    </edititemtemplate>
                                
                                <%--<asp:BoundField DataField="UOM" HeaderText="UOM" ReadOnly="True" />--%>
                                <asp:TemplateField HeaderText="Last dt">
                                <itemtemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("Last_Date") %>'>
                                
                                </itemtemplate>
                                <edititemtemplate>
                                    <asp:Label ID="Label5" runat="server" Text='<%# Bind("Last_Date") %>'>
                                </edititemtemplate>
                                
                                <asp:TemplateField HeaderText="Result">
                                <itemtemplate>
                                    <asp:Label ID="Label3"  runat="server" Text='<%# Bind("Result") %>'>
                                </itemtemplate>
                                <edititemtemplate>
                                    <asp:Label ID="Label7" runat="server" Text='<%# Bind("Result") %>'>
                                </edititemtemplate>
                                
                                
 
                                  <asp:TemplateField HeaderText="Test dt">
                                <itemtemplate>
                                    <asp:Label ID="Label9" runat="server" Text='<%# Bind("Current_Test_Date") %>'>
                                    </itemtemplate>
                                <edititemtemplate>
                                    <asp:TextBox ID="txttestdate" runat="server" Text='<%# Bind("Current_Test_Date") %>' CssClass="textboxInGrid">
                                    <asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txttestdate" Format="yy/dd/MM">
                                    
                                   </edititemtemplate>
                                
                               <%-- <asp:BoundField HeaderText="Test Result" />--%>
                               <asp:TemplateField HeaderText="Test Result">
                               <itemtemplate>
                                   <asp:Label ID="Label8" runat="server" Text='<%# Bind("Test_Result") %>'>
                               </itemtemplate>
                               <edititemtemplate>
                                   <asp:TextBox ID="txttestresult" runat="server" Text='<%# Bind("Test_Result") %>' CssClass="textboxInGrid">
                               </edititemtemplate>
                               
 
                                <asp:TemplateField HeaderText="Measurement Frequency">
                                    
                                    <itemtemplate>
                                        <asp:Label ID="Label2" runat="server" 
                                            Text='<%# Bind("Measurement_Frequency") %>'>
                                    </itemtemplate>
                                    <edititemtemplate>
                                        <asp:DropDownList ID="ddlMeasurementFrequency" runat="server"  AutoPostBack="true"
                                            onselectedindexchanged="ddlMeasurementFrequency_SelectedIndexChanged">
                                            <asp:ListItem>Select Frequency
                                            <asp:ListItem Value="1">Daily
                                            <asp:ListItem Value="2">Weekly
                                            <asp:ListItem Value="3">Fortnightly
                                            <asp:ListItem Value="4">Monthly
                                            <asp:ListItem Value="5">Quarterly
                                            <asp:ListItem Value="6"> Half Yearly
                                            <asp:ListItem Value="7">Yearly
                                            <asp:ListItem Value="8">Others
                                        
                                    </edititemtemplate>
                                
                                <asp:TemplateField HeaderText="Next Due dt">
                                <itemtemplate>
                                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("Next_Due_Date") %>'>
                                </itemtemplate>
                                <edititemtemplate>
                                    <asp:TextBox ID="txtnextduedate" runat="server" Text='<%# Bind("Next_Due_Date") %>' CssClass="textboxInGrid">
                                    <asp:CalendarExtender ID="CalendarExtender2" runat="server"  TargetControlID="txtnextduedate" Format="yy/dd/MM">
                                    
                                </edititemtemplate>
                                
                          
                            </columns>
                            <footerstyle cssclass="GridFooter" />
                            <HeaderStyle CssClass="grdheaderstyle"></HeaderStyle>
                            <rowstyle cssclass="grdrowstyle" />

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`()
   BEGIN
      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);
   END;
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
ujali428
Edited 4-Jan-13 20:36pm
v2
Comments
jibesh at 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
good
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 Smile | :)
  Permalink  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Shai Vashdi 576
1 OriginalGriff 183
2 Tadit Dash 160
3 Sergey Alexandrovich Kryukov 136
4 praveen_07 115
0 Sergey Alexandrovich Kryukov 9,280
1 OriginalGriff 5,473
2 Peter Leow 4,100
3 Maciej Los 3,540
4 Abhinav S 3,333


Advertise | Privacy | Mobile
Web03 | 2.8.140415.2 | Last Updated 7 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid