收录日期:2020/10/28 10:13:49 时间:2010-09-07 02:23:58 标签:asp.net,sqldatasource,bulk

MSDN Library has a walkthrough for bulk updates using a SqlDataSource.

http://msdn.microsoft.com/en-us/library/aa992036(v=VS.90).aspx

Not sure what I'm doing wrong, but I keep getting an error at:

currentID = Convert.ToInt32(GridDocuments.DataKeys(0).Value)

Are there other resources for SqlDataSource bulk updates?

The line in the example reads:

currentID = Convert.ToInt32(GridView1.DataKeys[r.RowIndex].Value);

This line assumes that you are setting datakeys on your grid, pay special attention to the DataKeyNames attribute in the example: DataKeyNames="EmployeeID"

This example is a little easier to follow. If you would like help debugging the other example please post the error your getting as well.