updating from from gridview is soooo confusing
-
i want to update data from gridview i tried to do but always getting strange errors .... i m using update [tab] set [name field] = [@parameter1] where [id field] = [@parameter2] in my sqldatasource but dont know where to provide these parameters value specially when the controls is inside gridview which cant be accessed that easily.... can any1 explain this ?? thankx. i can do this manually by defining template edit, update, cancel field when on clicking update execute my manual update code. i m asking for non-manual way to do it.
-
i want to update data from gridview i tried to do but always getting strange errors .... i m using update [tab] set [name field] = [@parameter1] where [id field] = [@parameter2] in my sqldatasource but dont know where to provide these parameters value specially when the controls is inside gridview which cant be accessed that easily.... can any1 explain this ?? thankx. i can do this manually by defining template edit, update, cancel field when on clicking update execute my manual update code. i m asking for non-manual way to do it.
for updating the data fields in a grid view , u may hav to do a little changes in the properties of the Grid view. first, u select the data source of the Grid and after putting the update query with the parameters , Go to the Grid view properties and select the "DatakeyNames" prop. and then frm that select ur "id field" for it. After that u select the smart tag of Grid view : check the "Enable Editing" and then go for "Edit Colums". From that , first uncheck "Auto-gen. fields" check box then add from "Command fields" the Edit,update etc. then add all the "Bound fields "(if u can't find it just refresh schema). Then finally, select the added bounded fields and put the fields to edit and make its "readonly" prop. as false and others must b true.