Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8826417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:07:52+00:00 2026-06-14T07:07:52+00:00

Anybody know how to get a Templatefield column of text-boxes to feed data typed

  • 0

Anybody know how to get a Templatefield column of text-boxes to feed data typed into them back into a sql database using the SqlDataSource already being used in the gridview the templatefield is in and a buttonfield using an update function? I was just wondering if anybody has any idea how to get this to work because I haven’t been able to find any way of doing this.

Please let me know if any of you need any more information to help you solve this dilemma.

I am able to get the information to feed back into the SQL server if i enable edit and change the information in the textbox as well as another column’s field in the same row, but it won’t update if I only change the information in the textbox whether in edit mode or just clicking the update button.

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<center>
<form id="form1" runat="server">
<div>

    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="Brdcst_Nbr" DataSourceID="SqlDataSource1" 
        EmptyDataText="There are no data records to display." Width="657px">
        <Columns>
            <asp:BoundField DataField="Brdcst_Nbr" HeaderText="Brdcst_Nbr"     ReadOnly="True" 
                SortExpression="Brdcst_Nbr" />
            <asp:BoundField DataField="Item_Nbr" HeaderText="Item_Nbr" 
                SortExpression="Item_Nbr" ReadOnly="True" />
            <asp:CheckBoxField DataField="IsPicked" HeaderText="IsPicked" 
                SortExpression="IsPicked" />
            <asp:TemplateField SortExpression="Row" HeaderText="Row">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Mode="twoway" AutoPostBack="true" CausesValidation="true" Text='<%# Bind("Row") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Mode="twoway" AutoPostBack="true" CausesValidation="true" Text='<%# Bind("Row") %>'></asp:TextBox>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:ButtonField ButtonType="Button" CommandName="Update" Text="Update" />
            <asp:ButtonField ButtonType="Button" CommandName="Edit" Text="Edit" />
        </Columns>
        <EditRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
        <RowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConflictDetection="CompareAllValues" 
        ConnectionString="<%$ ConnectionStrings:ORDCConnectionString1 %>" 
        DeleteCommand="DELETE FROM [Test_New_Transpick] WHERE [Brdcst_Nbr] = @original_Brdcst_Nbr AND (([Item_Nbr] = @original_Item_Nbr) OR ([Item_Nbr] IS NULL AND @original_Item_Nbr IS NULL)) AND [IsPicked] = @original_IsPicked AND (([Row] = @original_Row) OR ([Row] IS NULL AND @original_Row IS NULL))" 
        InsertCommand="INSERT INTO [Test_New_Transpick] ([Brdcst_Nbr], [Item_Nbr], [IsPicked], [Row]) VALUES (@Brdcst_Nbr, @Item_Nbr, @IsPicked, @Row)" 
        UpdateCommand="UPDATE [Test_New_Transpick] SET [IsPicked] = @IsPicked, [Row] = @Row WHERE [Brdcst_Nbr] = @original_Brdcst_Nbr" 
        OldValuesParameterFormatString="original_{0}" 
        ProviderName="<%$ ConnectionStrings:ORDCConnectionString1.ProviderName %>" 
        SelectCommand="SELECT * FROM [Test_New_Transpick]" >
        <DeleteParameters>
            <asp:Parameter Name="original_Brdcst_Nbr" Type="String" />
            <asp:Parameter Name="original_Item_Nbr" Type="String" />
            <asp:Parameter Name="original_IsPicked" Type="Boolean" />
            <asp:Parameter Name="original_Row" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Brdcst_Nbr" Type="String" />
            <asp:Parameter Name="Item_Nbr" Type="String" />
            <asp:Parameter Name="IsPicked" Type="Boolean" />
            <asp:Parameter Name="Row" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="Item_Nbr" Type="String" />
            <asp:Parameter Name="IsPicked" Type="Boolean" />
            <asp:Parameter Name="Row" Type="String" />
            <asp:Parameter Name="original_Brdcst_Nbr" Type="String" />
            <asp:Parameter Name="original_Item_Nbr" Type="String" />
            <asp:Parameter Name="original_IsPicked" Type="Boolean" />
            <asp:Parameter Name="original_Row" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>

</div>
</form>
</center>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:07:54+00:00Added an answer on June 14, 2026 at 7:07 am

    So, changing the property of the SQLdatabase from CompareAllValues to OverwriteChanges fixed this issue. It is now allowing the changes to be written back to the sql database by just changing the textbox in the row/column that needed to be updated without having to change anything else.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Anybody know if it's possible? I'm trying to get the data by using the
Anybody know how to get all of these in a C# app that leads
Does anybody know why I get this warning when I turn off the auto-commit
Does anybody know where I can get a free web crawler that actually works
Does anybody know How I can get the ckEdtior to work with Selenium. I'm
Does anybody know which version of sed is required to get option -i to
Does anybody know, how to get a list of leaf nodes in Prolog? Let's
Does anybody know some nice documentation about the ruby handsoap gem to get me
Does anybody know, is it possible and how can I get name of user
Does anybody know how to get rid of the annoying tooltips that pop up

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.