It seems other people have had this problem, but none of the solutions
proposed fixes my situation. If someone could review the code below
and tell me what I'm missing. Thank you!
<asp:FormView id="LogText" DataKeyNames="L ogID" runat="server"
DataSourceID="d sEdit" DefaultMode="Ed it">
<EditItemTempla te>
<asp:TextBox id="editText" runat="server" Text='<%#
Bind("LogText") %>' rows="25" columns="120" TextMode="Multi Line" />
<asp:Button Text="Save" CommandName="Up date"
runat="server" />
</EditItemTemplat e>
</asp:FormView>
<asp:SqlDataSou rce ID="dsEdit" runat="server"
ConnectionStrin g="Data Source=(local); Initial
Catalog=testDB; Integrated Security=True"
ProviderName="S ystem.Data.SqlC lient" SelectCommand=" usp_admin_edit"
UpdateCommand=" usp_admin_updat e" SelectCommandTy pe="StoredProce dure"
UpdateCommandTy pe="StoredProce dure"
OldValuesParame terFormatString ="{0}">
<UpdateParamete rs>
<asp:Paramete r name="id" Type="Int32" />
<asp:ControlPar ameter name="strLog"
ControlID="LogT ext$editText" PropertyName="T ext" Type="String" />
</UpdateParameter s>
<SelectParamete rs>
<asp:QueryStrin gParameter DefaultValue="0 " Name="id"
QueryStringFiel d="LogID" Type="Int32" />
</SelectParameter s>
</asp:SqlDataSour ce>
CREATE PROCEDURE [dbo].[usp_admin_updat e]
@id int,
@strLog text
AS
UPDATE tbl_Test
SET
LogText = @strLog
WHERE LogID = @id
proposed fixes my situation. If someone could review the code below
and tell me what I'm missing. Thank you!
<asp:FormView id="LogText" DataKeyNames="L ogID" runat="server"
DataSourceID="d sEdit" DefaultMode="Ed it">
<EditItemTempla te>
<asp:TextBox id="editText" runat="server" Text='<%#
Bind("LogText") %>' rows="25" columns="120" TextMode="Multi Line" />
<asp:Button Text="Save" CommandName="Up date"
runat="server" />
</EditItemTemplat e>
</asp:FormView>
<asp:SqlDataSou rce ID="dsEdit" runat="server"
ConnectionStrin g="Data Source=(local); Initial
Catalog=testDB; Integrated Security=True"
ProviderName="S ystem.Data.SqlC lient" SelectCommand=" usp_admin_edit"
UpdateCommand=" usp_admin_updat e" SelectCommandTy pe="StoredProce dure"
UpdateCommandTy pe="StoredProce dure"
OldValuesParame terFormatString ="{0}">
<UpdateParamete rs>
<asp:Paramete r name="id" Type="Int32" />
<asp:ControlPar ameter name="strLog"
ControlID="LogT ext$editText" PropertyName="T ext" Type="String" />
</UpdateParameter s>
<SelectParamete rs>
<asp:QueryStrin gParameter DefaultValue="0 " Name="id"
QueryStringFiel d="LogID" Type="Int32" />
</SelectParameter s>
</asp:SqlDataSour ce>
CREATE PROCEDURE [dbo].[usp_admin_updat e]
@id int,
@strLog text
AS
UPDATE tbl_Test
SET
LogText = @strLog
WHERE LogID = @id