Updating gridview in asp net 2 0
ALTER PROCEDURE users_Update Faculty @EMAIL NVARCHAR(100), @ISLOCKEDOUT BIT, @MOBILENUMBER BIGINT, @USERNAME nvarchar(100) AS BEGIN UPDATE aspnet_Users SET [email protected] where [email protected] UPDATE ASPNET_MEMBERSHIP SET EMAIL = @EMAIL, LOWEREDEMAIL = LOWER(@EMAIL), [email protected] WHERE USERID = (SELECT USERID FROM ASPNET_USERS WHERE [email protected]) END Found the solution: The Select Columns and the Update Parameters should match in order to update using Sql Data Source, that means if you select(query or procedure) is returning 3 fields in gridview, then all of them should be the parameter for the update, you can miss out the actual updations in database if not required, but the I dont think your solution is OK, since I have to use the atribute Old Values Parameter Format String="original_" that means that I would have doble parameters, the ones with the original values and the ones with edited values. I have 4 parameters, Im getting the right values for 2 of them, an null at the others. Read this: The order of the parameters in the Update Parameters collection might be important, depending on the ADO. Odbc providers associate the parameters in the collection according to the order that the parameters appear in the parameterized SQL query. For more information about parameterized SQL queries and commands, see Using Parameters with the Sql Data Source Control.This happens when I | try to delete the row as well.
When the data source automatically sets up it writes the SQL script strange and puts brackets around everything. Also, the html that is automatically generated by the gridview control was missing the paremeters required to update or delete. "Steven Cheng[MSFT]" Hi Washoetech, Welcome to ASPNET newsgroup.In the gridview tasks I | selected enable edit checkbox so that it automatically adds the edit link to | each row.When the link is selected it goes into edit mode and when the row | is edited I click the update link and nothing updates. Once I checked Is Post Back in Row Updating event.. Configuration; public partial class _Default1 : System. Actually last night I spent many hours on this issue .