T
teclioness
Hi,
I am using gridview and sql datasource for select and update. When I
click on edit link against the records, the row is shows in edit mode.
When I make a change to it, the change is not updated and no errors
returned.
Here is the source.. Please help.
<asp:GridView ID="gvEvidence" runat="server" AllowPaging="True"
AllowSorting="True"
AutoGenerateColumns="False" BackColor="LightGoldenrodYellow"
BorderColor="Tan"
BorderWidth="1px" CellPadding="2" Font-Bold="False"
Font-Overline="False" Font-Size="1.25em" ForeColor="Black"
Width="100%" DataKeyNames="FrameworkEvidenceId"
DataSourceID="DSEvidenceForAction">
<FooterStyle BackColor="Tan" Font-Size="1.2em" />
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:BoundField DataField="ActionMasterDisplayNo"
HeaderText="Action No." SortExpression="ActionMasterDisplayNo"
ReadOnly="True" />
<asp:BoundField DataField="ActionMasterDesc"
HeaderText="Action" SortExpression="ActionMasterDesc" ReadOnly="True"
/>
<asp:TemplateField HeaderText="Achieved"
SortExpression="FrameworkEvidenceAchieved"
ConvertEmptyStringToNull="False">
<EditItemTemplate>
<aspropDownList ID="cboAchieved" runat="server"
SelectedValue='<%# Bind("FrameworkEvidenceAchieved") %>'>
<asp:ListItem Selected="True"
Value="yes">Yes</asp:ListItem>
<asp:ListItem Value="no">No</asp:ListItem>
<asp:ListItem Value="partial progress">Partial
Progress</asp:ListItem>
<asp:ListItem Value="not applicable">Not
Applicable</asp:ListItem>
<asp:ListItem
Value="-">--Select--</asp:ListItem>
</aspropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
Bind("FrameworkEvidenceAchieved") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Evidence"
SortExpression="FrameworkEvidenceDesc"
ConvertEmptyStringToNull="False">
<EditItemTemplate>
<asp:TextBox ID="txtEvidenceDesc" runat="server"
Text='<%# Bind("FrameworkEvidenceDesc") %>'
TextMode="MultiLine"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%#
Bind("FrameworkEvidenceDesc") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Evidence Ref"
SortExpression="FrameworkEvidenceRef" ConvertEmptyStringToNull="False">
<EditItemTemplate>
<asp:TextBox ID="txtEvidenceRef" runat="server"
MaxLength="150" Text='<%# Bind("FrameworkEvidenceRef")
%>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%#
Bind("FrameworkEvidenceRef") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Updated By"
SortExpression="FrameworkEvidenceUpdatedBy"
ConvertEmptyStringToNull="False">
<EditItemTemplate>
<asp:Label ID="lblUpdatedBy" runat="server"
Text="<%# GetLoggedInUserId() %>"></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%#
Bind("FrameworkEvidenceUpdatedBy") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Date"
SortExpression="FrameworkEvidenceUpdatedDate"
ConvertEmptyStringToNull="False">
<EditItemTemplate>
<asp:Label ID="lblUpdatedDate" runat="server"
Text="<%# now() %>"></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%#
Bind("FrameworkEvidenceUpdatedDate") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<SelectedRowStyle BackColor="DarkSlateBlue"
ForeColor="GhostWhite" Font-Size="1.25em" />
<PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue"
HorizontalAlign="Center" />
<HeaderStyle BackColor="Tan" Font-Bold="True" />
<AlternatingRowStyle BackColor="PaleGoldenrod" />
<EditRowStyle BackColor="Gold" BorderColor="HotTrack"
Font-Size="1.25em" />
<EmptyDataTemplate>
Sorry, no data available.
</EmptyDataTemplate>
<EmptyDataRowStyle Font-Size="1.25em" />
</asp:GridView>
<asp:SqlDataSource ID="DSEvidenceForAction" runat="server"
ConnectionString="<%$ ConnectionStrings:EqualitiesDbConn %>"
SelectCommand="ProcFrameworkEvidenceSelectALLByDeptId"
SelectCommandType="StoredProcedure" UpdateCommand="UPDATE
dbo.FrameworkEvidence SET FrameworkEvidenceAchieved =
@evidenceAchieved, FrameworkEvidenceRef = @evidenceRef,
FrameworkEvidenceDesc = @evidenceDesc, FrameworkEvidenceUpdatedBy =
@updatedBy, FrameworkEvidenceUpdatedDate = @updatedDate WHERE
(FrameworkEvidenceId = @frameid)">
<SelectParameters>
<asparameter DefaultValue="3" Name="dept_id" Type="Int64"
/>
</SelectParameters>
<UpdateParameters>
<asparameter Name="evidenceAchieved" Type="String" />
<asparameter Name="evidenceRef" Type="String" />
<asparameter Name="evidenceDesc" Type="String" />
<asparameter Name="updatedBy" Type="String" />
<asparameter Name="updatedDate" Type="DateTime" />
<asparameter Name="frameid" Type="Int64" />
</UpdateParameters>
</asp:SqlDataSource>
Thanks in advance!!
I am using gridview and sql datasource for select and update. When I
click on edit link against the records, the row is shows in edit mode.
When I make a change to it, the change is not updated and no errors
returned.
Here is the source.. Please help.
<asp:GridView ID="gvEvidence" runat="server" AllowPaging="True"
AllowSorting="True"
AutoGenerateColumns="False" BackColor="LightGoldenrodYellow"
BorderColor="Tan"
BorderWidth="1px" CellPadding="2" Font-Bold="False"
Font-Overline="False" Font-Size="1.25em" ForeColor="Black"
Width="100%" DataKeyNames="FrameworkEvidenceId"
DataSourceID="DSEvidenceForAction">
<FooterStyle BackColor="Tan" Font-Size="1.2em" />
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:BoundField DataField="ActionMasterDisplayNo"
HeaderText="Action No." SortExpression="ActionMasterDisplayNo"
ReadOnly="True" />
<asp:BoundField DataField="ActionMasterDesc"
HeaderText="Action" SortExpression="ActionMasterDesc" ReadOnly="True"
/>
<asp:TemplateField HeaderText="Achieved"
SortExpression="FrameworkEvidenceAchieved"
ConvertEmptyStringToNull="False">
<EditItemTemplate>
<aspropDownList ID="cboAchieved" runat="server"
SelectedValue='<%# Bind("FrameworkEvidenceAchieved") %>'>
<asp:ListItem Selected="True"
Value="yes">Yes</asp:ListItem>
<asp:ListItem Value="no">No</asp:ListItem>
<asp:ListItem Value="partial progress">Partial
Progress</asp:ListItem>
<asp:ListItem Value="not applicable">Not
Applicable</asp:ListItem>
<asp:ListItem
Value="-">--Select--</asp:ListItem>
</aspropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
Bind("FrameworkEvidenceAchieved") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Evidence"
SortExpression="FrameworkEvidenceDesc"
ConvertEmptyStringToNull="False">
<EditItemTemplate>
<asp:TextBox ID="txtEvidenceDesc" runat="server"
Text='<%# Bind("FrameworkEvidenceDesc") %>'
TextMode="MultiLine"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%#
Bind("FrameworkEvidenceDesc") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Evidence Ref"
SortExpression="FrameworkEvidenceRef" ConvertEmptyStringToNull="False">
<EditItemTemplate>
<asp:TextBox ID="txtEvidenceRef" runat="server"
MaxLength="150" Text='<%# Bind("FrameworkEvidenceRef")
%>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%#
Bind("FrameworkEvidenceRef") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Updated By"
SortExpression="FrameworkEvidenceUpdatedBy"
ConvertEmptyStringToNull="False">
<EditItemTemplate>
<asp:Label ID="lblUpdatedBy" runat="server"
Text="<%# GetLoggedInUserId() %>"></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%#
Bind("FrameworkEvidenceUpdatedBy") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Date"
SortExpression="FrameworkEvidenceUpdatedDate"
ConvertEmptyStringToNull="False">
<EditItemTemplate>
<asp:Label ID="lblUpdatedDate" runat="server"
Text="<%# now() %>"></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%#
Bind("FrameworkEvidenceUpdatedDate") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<SelectedRowStyle BackColor="DarkSlateBlue"
ForeColor="GhostWhite" Font-Size="1.25em" />
<PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue"
HorizontalAlign="Center" />
<HeaderStyle BackColor="Tan" Font-Bold="True" />
<AlternatingRowStyle BackColor="PaleGoldenrod" />
<EditRowStyle BackColor="Gold" BorderColor="HotTrack"
Font-Size="1.25em" />
<EmptyDataTemplate>
Sorry, no data available.
</EmptyDataTemplate>
<EmptyDataRowStyle Font-Size="1.25em" />
</asp:GridView>
<asp:SqlDataSource ID="DSEvidenceForAction" runat="server"
ConnectionString="<%$ ConnectionStrings:EqualitiesDbConn %>"
SelectCommand="ProcFrameworkEvidenceSelectALLByDeptId"
SelectCommandType="StoredProcedure" UpdateCommand="UPDATE
dbo.FrameworkEvidence SET FrameworkEvidenceAchieved =
@evidenceAchieved, FrameworkEvidenceRef = @evidenceRef,
FrameworkEvidenceDesc = @evidenceDesc, FrameworkEvidenceUpdatedBy =
@updatedBy, FrameworkEvidenceUpdatedDate = @updatedDate WHERE
(FrameworkEvidenceId = @frameid)">
<SelectParameters>
<asparameter DefaultValue="3" Name="dept_id" Type="Int64"
/>
</SelectParameters>
<UpdateParameters>
<asparameter Name="evidenceAchieved" Type="String" />
<asparameter Name="evidenceRef" Type="String" />
<asparameter Name="evidenceDesc" Type="String" />
<asparameter Name="updatedBy" Type="String" />
<asparameter Name="updatedDate" Type="DateTime" />
<asparameter Name="frameid" Type="Int64" />
</UpdateParameters>
</asp:SqlDataSource>
Thanks in advance!!