Avatar of jaydwest
jaydwest

asked on 

DataGridView Error Message - Any Suggestions

I'm getting the following error message when I  open a form with a datagridview.  Any suggestions as to what the problem is or how to troubleshot it?

Exception found in procedure: 'DataGridView1_DataError'
(System.Windows.Forms.DataGridViewElementStates GetRowState(Int32))

Row index provided is out of range.
Parameter name: rowIndex

Click [OK] button to Exit.
.NET ProgrammingVisual Basic.NETMicrosoft SQL Server 2005

Avatar of undefined
Last Comment
jaydwest
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

According to the error message you have index pass the end of the available number of rows. Can you show the code?
Avatar of jaydwest
jaydwest

ASKER

It blows on the FillByQuoteNumb line

'-- Load DataGridView4
Dim intRowCount as long
Me.QuoteReqTableAdapter.FillByQuoteNumb(Me.dsetQuote_Entry.QuoteReq, strQuoteNumb, intRowCount)
Avatar of jaydwest
jaydwest

ASKER

In testing there should be 3 rows.  It blows when the first row is displayed.
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

The object, Me.dsetQuote_Entry, sounds like a dataset ?
What is QuoteReq in the statement, Me.dsetQuote_Entry.QuoteReq ?
Avatar of jaydwest
jaydwest

ASKER

It's the tableName
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of jaydwest
jaydwest

ASKER

THis is a real crazy problem.  When I open the form the datagrid view blows on the first row (of 3)  but when I click OK to the error message 3 rows are displayed but there is a field in the 4th row, so your first guess looks right.  However when I run the underlying stored proc, it only displays 3 rows.  

This is wierd.
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo