Mr_Shaw
asked on
sql update via gridview
I have a gridview which I am updating using code.
I have ran into a mess with the update as data is not beign added to the correct columns.
On SQL 2005 my stored procedure works fine, but when I execute the code to input the details things just don't match.
I have ran into a mess with the update as data is not beign added to the correct columns.
On SQL 2005 my stored procedure works fine, but when I execute the code to input the details things just don't match.
ASKER
my code is:
my code is
protected void edit_record_updating(objec t sender, GridViewUpdateEventArgs e)
{
update_class update_records_method = new update_class();
update_records_method.Reco rd_ID = ((TextBox)user_records.Row s[e.RowInd ex].Cells[ 2].Control s[0]).Text .ToString( );
update_records_method.Logo n_Name = WindowsIdentity.GetCurrent ().Name.To String();
update_records_method.Reco rd_Class = ((TextBox)user_records.Row s[e.RowInd ex].Cells[ 4].Control s[0]).Text .ToString( );
update_records_method.Reco rd_Name = ((TextBox)user_records.Row s[e.RowInd ex].Cells[ 6].Control s[0]).Text .ToString( );
}
I did not use andy datakeyname as I am not sure how to use this property.
my code is
protected void edit_record_updating(objec
{
update_class update_records_method = new update_class();
update_records_method.Reco
update_records_method.Logo
update_records_method.Reco
update_records_method.Reco
}
I did not use andy datakeyname as I am not sure how to use this property.
in your case its not require (datakeys)
are you getting this record correct
update_records_method.Reco rd_ID = ((TextBox)user_records.Row s[e.RowInd ex].Cells[ 2].Control s[0]).Text .ToString( );
also what problem you are getting in update ...
are you getting this record correct
update_records_method.Reco
also what problem you are getting in update ...
ASKER
I have tested my code using break points and I have concluded that the following;
When I click the Edit button on the gridview TextBoxes appear to allow me to edit the content.
When I click the Update button the code does not recognise that the TextBoxes have been updated and no change is made.
I have tested the code with other virables which works successfully (i.e new values are inserted and appear in the gridview). There is something wrong with the way i am picking up the editted values from the gridview.
When I click the Edit button on the gridview TextBoxes appear to allow me to edit the content.
When I click the Update button the code does not recognise that the TextBoxes have been updated and no change is made.
I have tested the code with other virables which works successfully (i.e new values are inserted and appear in the gridview). There is something wrong with the way i am picking up the editted values from the gridview.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
also paste your code here ...