With SQL Server 2012, we can do that in just few lines.Here is a quick sample script to query 10 records after 50"This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. ID); This results in a Null reference exception (it hasnt been found) Please any ideas? runat="server" Allow Paging="True" Allow Sorting="True" Data Source ID="Sql Data Source1" Cell Padding="4" Fore Color="#333333" Grid Lines="None" Auto Generate Columns="False" Font-Size="X-Small" Height="356px" Width="2696px" Is it generating the edit button in the first column (default)? Edit: never mind, this is in the row editing event - the cell hasn't generated the edit template yet I don't think. I'm giving examples, not typing up your whole app for you.
I have a Grid View control and use old style manual binding with a Data Source property and invoke the Data Bind() method. I'm giving examples, not typing up your whole app for you. If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If this post contains any code, I may or may not have tested it. If this post contains any code, I may or may not have tested it.