Solved

UPDATE Command in SqlDataSource Control Works Only Once

Posted on 2008-10-17
2
378 Views
Last Modified: 2012-06-27
I have a simple ASP.NET page where I am updating a user's selection via a dropdown list.  i.e., They make a choice; they have a value stored in the backend database table representing that value (choice).  The Choice table holds both the user's ID and the choice ID.  When I first initiate the table (more on what that means in a second), I can use an EditItemTemplate to change any of the choice values for any of the players only ONCE EACH.  i.e., If I go back to change a field value that I have already changed once, it will not accept the change a subsequent time.  However, and this is what I mean by initiate the table, when I make changes in values directly in the database tables, it sort of resets the table and/or values and "starts it over" so I can make changes again when I launch the page.  Then I can do this all over again, once for each user.  I have gone over and over my SQL and I am sure it is correct.  I have looked at the table properties and am not finding anything that would be a permission or table/field property issue.  I hope this is enough infirmation for someone to offer assistance and/or suggestions.  Thanks in advance.  Also, this is someone else's project.  He came to me for help and I'm stuck.  I'll check with him and if OK, I'll attach a code snippet to help this along.  Thanks again!
0
Comment
Question by:Wizard_Microsystems
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
divyeshhdoshi earned 400 total points
ID: 22738366
If you have used datareader for sqldatasource then change it with dataset.

when u update any row then you need to commit that row.
This problem is due to "The row is changed and not committed"
so that it is not allowed to edit that row.

0
 

Author Closing Comment

by:Wizard_Microsystems
ID: 31507060
This should have been taken care of in the UPDATE command within the SqlDataSource control.  I thought there was corruption somwhere, got tired of trying to find and fix the "needle in the haystack", and so just rebuilt the whole project in about an hour.  Works great now.  I believe you were on the correct path -- you affirmed my hunches, divyeshhdoshi.  Thank you.
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question