• Erland is right - you only need one round-trip to the database instead of one for each row.

    In .NET, when you bind data to a grid, it's usually done in the code-behind and is very straightforward. This is where you use a SQL statement and include the ORDER BY clause. The user is then free to edit the fields. When the user clicks save, do the client-side validation then do your validation in the code-behind. Create and populate your table-value parameter and then call your procedure.

    I don't know which development environment you're using, but I'd imagine that there would be something similar.