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 906701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:25:53+00:00 2026-05-15T16:25:53+00:00

So below is my code. Where I’m having the issue is my bound text

  • 0

So below is my code. Where I’m having the issue is my bound text fields are not sending the information back to the UpdateCommand as expected. If I replace any of the @variables with hard coded text then the update occurs as expected. So if I replace @RegID with ’25’ then my record is successfully updated but blank as all other @variables were NULL at time of update processing. Where’s my error?

         <asp:FormView ID="formView" DataSourceID="Reg" runat="server" DataKeyNames="RegID" AllowPaging="true">

        <ItemTemplate>
            <h3 style="font-size:14px;"><%#Eval("Org") %></h3>
            <table border="0">
                <tr class="RowHighlight">
                    <td>Name:</td><td><%#Eval("Name") %></td>
                </tr>
                <tr>
                    <td>Phone Number:</td><td><%#Eval("PhoneNumber") %></td>
                </tr>
                <tr class="RowHighlight">
                    <td>Email Address:</td><td><%#Eval("EmailAddress")%></td>
                </tr>
                <tr>
                    <td>Address:</td><td><%#Eval("Address") %></td>
                </tr>
                <tr class="RowHighlight">
                    <td>Purchase Date:</td><td><%#Eval("MonthOfPurchase") + " " + Eval("YearOfPurchase")%></td>
                </tr>
                <tr>
                    <td>Notes:</td><td><%#Eval("Notes") %></td>
                </tr>
                <tr>
                    <td><asp:LinkButton ID="btnEdit" Text="Edit Details" runat="server" CommandName="Edit" /></td>
                </tr>
            </table>
        </ItemTemplate>

        <EditItemTemplate>
            <h3 style="font-size:14px;"><%#Eval("Org") %></h3>
            <table border="0">
                <tr>
                    <td>ID</td><td><%#Eval("RegID")%></td>
                </tr>
                <tr class="RowHighlight">
                    <td>Name:</td><td><asp:TextBox ID="txtName" runat="server" Width="100%" Text='<%# Bind("Name") %>' /></td>
                </tr>
                <tr>
                    <td>Phone Number:</td><td><asp:TextBox ID="txtPhoneNumber" runat="server" Width="100%" Text='<%# Bind("PhoneNumber") %>' /></td>
                </tr>
                <tr class="RowHighlight">
                    <td>Email Address:</td><td><asp:TextBox ID="txtEmailAddress" runat="server" Width="100%" Text='<%# Bind("EmailAddress") %>' /></td>
                </tr>
                <tr>
                    <td>Address:</td><td><asp:TextBox ID="txtAddress" runat="server" Width="100%" Text='<%# Bind("Address") %>' /></td>
                </tr>
                <tr class="RowHighlight">
                    <td>Month Of Purchase:</td><td><asp:TextBox ID="txtMonthOfPurchase" runat="server" Width="100%" Text='<%# Bind("MonthOfPurchase") %>' /></td>
                </tr>
                <tr>
                    <td>Year Of Purchase:</td><td><asp:TextBox ID="txtYearOfPurchase" runat="server" Width="100%" Text='<%# Bind("YearOfPurchase") %>' /></td>
                </tr>
                <tr class="RowHighlight">
                    <td>Notes:</td><td><%#Eval("Notes") %></td>
                </tr>
                <tr>
                    <td><asp:LinkButton ID="btnSave" Text="Save Changes" runat="server" CausesValidation="true" CommandName="Update" /></td>
                    <td><asp:LinkButton ID="btnCancel" Text="Cancel" runat="server" CommandName="Cancel" /></td>
                </tr>
            </table>
        </EditItemTemplate>

        </asp:FormView>

        <asp:SqlDataSource ProviderName="System.Data.Odbc" ID="Reg" runat="server"
            ConnectionString="DRIVER={MySQL ODBC 3.51 Driver}; SERVER=<SERVER_NAME>; PORT=3306; DATABASE=<DATABASE> UID=<USERID>; PWD=<PASSWORD>; OPTION=3;"

            SelectCommand="SELECT * FROM tblRegsitration 
            WHERE EmailSent=0 ORDER BY Org"

            UpdateCommand="UPDATE tblRegsitration SET Name=@Name, 
            PhoneNumber=@PhoneNumber, 
            EmailAddress=@EmailAddress,
            Address=@Address, 
            MonthOfPurchase=@MonthOfPurchase, 
            YearOfPurchase=@YearOfPurchase 
            WHERE (RegID=@RegID)" />
  • 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-05-15T16:25:54+00:00Added an answer on May 15, 2026 at 4:25 pm

    You don’t have any parameters defined.

    Example:

    <asp:sqlDataSource ID="EmployeeDetailsSqlDataSource" 
      SelectCommand="SELECT EmployeeID, LastName, FirstName FROM Employees WHERE EmployeeID = @EmpID"
    
      InsertCommand="INSERT INTO Employees(LastName, FirstName) VALUES (@LastName, @FirstName); 
                     SELECT @EmpID = SCOPE_IDENTITY()"
      UpdateCommand="UPDATE Employees SET LastName=@LastName, FirstName=@FirstName 
                       WHERE EmployeeID=@EmployeeID"
      DeleteCommand="DELETE Employees WHERE EmployeeID=@EmployeeID"
    
      ConnectionString="<%$ ConnectionStrings:NorthwindConnection %>"
      OnInserted="EmployeeDetailsSqlDataSource_OnInserted"
      RunAt="server">
    
      <SelectParameters>
        <asp:Parameter Name="EmpID" Type="Int32" DefaultValue="0" />
      </SelectParameters>
    
      <InsertParameters>
        <asp:Parameter Name="EmpID" Direction="Output" Type="Int32" DefaultValue="0" />
      </InsertParameters>
    
    </asp:sqlDataSource>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 463k
  • Answers 463k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I came across the same error using xtreemhost.com's free hosting,… May 16, 2026 at 12:50 am
  • Editorial Team
    Editorial Team added an answer The verbose argument should do what you want. Content copied… May 16, 2026 at 12:50 am
  • Editorial Team
    Editorial Team added an answer After trying everything I could think of, my last hope… May 16, 2026 at 12:50 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.