I used Update Method to save the edit details but this method only gets the ID of the primary table.The data of the secondary\foreign key value isn't available.I want a way to just write something like Data Source["value"] to get the value. This will cause a clash, as you will be sending two columns with the same name.If that isn't the problem, the you will need to post more code.
I think it is not holding the value that i entered in the Grid. Thank you Your column headings or SQL field names will automatically be declared as variables.If you do not want the formatting as part of the value stored, you will need to remove the formatting programmatically.Hi , I've a requirement to update the data in gridview.Something like Sql Connection con = new Sql Connection(CON_STR) or perhaps a using like in my example. Make sure the parameters on the update match the field names (@branch Name, @Parent Id). Giving me an error in the browser: Must declare the scalar variable "@Locations".Furthermore there is no execute Non Query() and grid View2. I have tested this code, and it reads the table, and allows the edits of the records. If I remove Insert Visible="False" Read Only="True", its working but all the other rows rows are getting edited with the same values.