Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > [GridView] Deleting last item causes ArgumentOutOfRangeExceptionwhen using Stored Procedures

Reply
Thread Tools

[GridView] Deleting last item causes ArgumentOutOfRangeExceptionwhen using Stored Procedures

 
 
mc
Guest
Posts: n/a
 
      05-17-2007
I've been scratching my head for quite a few hours over this issue and thought It might be useful if
I share my answer.

Turns out if you are using a stored procedure to delete items from the GridView which updates
multiple tables or fires triggers this will effect the @@ROWCOUNT value which seems to trip up the
rendering of the GridView when deleting the last item.

The fix I settled on was to place a SET NOCOUNT ON at the start of your stored procedure and a SET
NOCOUNT OFF at the end.

Regards


MC
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WebControl - CollectionEditor Problem. Changing id property of new added collection item causes not adding item to collection - Sergio ASP .Net Web Controls 0 05-29-2006 06:20 AM
Urgent problem - Stored Procedures using Created. Tables Mike Hutton ASP .Net 2 07-12-2004 10:40 AM
paging datagrid using stored procedures? Max ASP .Net 2 01-13-2004 02:09 AM
turning Resultsets Using Sql Server Stored Procedures... Amber ASP .Net 0 10-07-2003 03:05 AM
VB.NET Retrieving Identity form MSSQL2000 without using stored procedures Taras ASP .Net 2 10-05-2003 05:35 AM



Advertisments