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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:47:13+00:00 2026-05-25T01:47:13+00:00

I am using Datagrid and SQLDataSource to bind data from just one table. In

  • 0

I am using Datagrid and SQLDataSource to bind data from just one table. In order to enable update, I have write update query which I wrong like this.

update mytable field1=@field1, field2=@field2 where ID=@ID

When I click edit, i get into edit mode. When I submit a change, the change is not submitted and I get no error. Do I need to change something somewhere else? I did not modify any C# code in this example.

Edit:
If I omit where ID=@ID, then the whole column is successfully changed but it does not work with ID=@ID. What is wrong here?

Edit: Code

<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:MyConnectionString %>" 
        SelectCommand="SELECT [my_id], [ID], [FirstName], [LastName], [ApplicationUserName] FROM [member_tbl]" 

        UpdateCommand="UPDATE [member_tbl] SET [my_id] = @my_id, [FirstName] = @FirstName, [LastName] = @LastName, [ApplicationUserName] = @ApplicationUserName where ID = @ID">
        <UpdateParameters>
            <asp:Parameter Name="my_id" Type="Int32"/>
            <asp:Parameter Name="FirstName" />
            <asp:Parameter Name="LastName" />
            <asp:Parameter Name="ApplicationUserName" />
            <asp:Parameter Name="id" />
        </UpdateParameters>
    </asp:SqlDataSource>
  • 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-25T01:47:14+00:00Added an answer on May 25, 2026 at 1:47 am

    Answering myself: I found that in order for this to work, the ID column must be the primary key (or may be unique column), otherwise it will not work and wont give you any error, which is a bit strange.

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

Sidebar

Related Questions

I am using datagrid view. Data gets added in the table and from the
I have data source and table that I can bind to my controls and
I'm using the datagrid from the WPF Toolkit for 3.5. I have a need
I have a web page displaying data using dojo datagrid. Sometimes, users need to
I'm using a datagrid/table construct and the data is appearing over the column headers
Using a DataGrid from WPFToolkit, I bind it to a datatable. On certain scenario
Hello I am developing one wpf application. I am using datagrid from wpf toolkit.
I am using a Datagrid with several columns of data (call it myDG) and
I am using a DataGrid in Expression Blend but I just need to show
I am using Advanced DataGrid of Flex 3 with hierarchical data. The itemRenderer is

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.