Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > What does 'Index 0 is not non-negative and below total rows count.' mean when binding controls

Reply
Thread Tools

What does 'Index 0 is not non-negative and below total rows count.' mean when binding controls

 
 
Craig Burkett
Guest
Posts: n/a
 
      09-10-2003
I have a web form populated mostly with labels and I also have a schema file
that describes the columns in a dataset coming back from a database call. I
dragged a dataset control to the web page and tied it to the schema. After
doing this I went to each label and set up each control's databindings,
tying the text property to the appropriate field. To initially test it I
created a function which returns a dataset built dynamically in code with
the expected fields and field names and types. The returned dataset was
successfully bound to the fields, so after finally receiving info about the
database and the fields in the table I need to access I created the
appropriate SQL statement and got a dataset back. It successfuly merged
with the typed dataset, but when I go to call the Databind method on the
first label on the form things fail. That is when I get 'Index 0 is not
non-negative and below total rows count'. I've verified the types and names
of the fields returned and I just can't see where the mis-match is.

Help!
Craig Burkett

 
Reply With Quote
 
 
 
 
Rajiv
Guest
Posts: n/a
 
      09-11-2003
Hi Craig,

I didnt myself try it but from what I understand by a
couple of other posts on the net is that, this is 'cos no
rows are returned from the sql query.

Check if this discussion helps:
http://www.dotnet247.com/247referenc.../13/65881.aspx

Hope it helps. If the prob persists, please make a post.

Cheers!
Rajiv
>-----Original Message-----
>I have a web form populated mostly with labels and I also

have a schema file
>that describes the columns in a dataset coming back from

a database call. I
>dragged a dataset control to the web page and tied it to

the schema. After
>doing this I went to each label and set up each control's

databindings,
>tying the text property to the appropriate field. To

initially test it I
>created a function which returns a dataset built

dynamically in code with
>the expected fields and field names and types. The

returned dataset was
>successfully bound to the fields, so after finally

receiving info about the
>database and the fields in the table I need to access I

created the
>appropriate SQL statement and got a dataset back. It

successfuly merged
>with the typed dataset, but when I go to call the

Databind method on the
>first label on the form things fail. That is when I

get 'Index 0 is not
>non-negative and below total rows count'. I've verified

the types and names
>of the fields returned and I just can't see where the mis-

match is.
>
>Help!
>Craig Burkett
>
>.
>

 
Reply With Quote
 
 
 
 
Craig Burkett
Guest
Posts: n/a
 
      09-11-2003
I've figured it out. The basic problem is that Microsoft's documentation
and help tips are confusing and misleading. For instance, the fill
command's help tip pops up and says the tablename parameter (on the second
function signature) is the table source name. To me this implies the name
of the table contained in the data adaptor. In actuallity it will be the
name assigned to the table created in the dataset.

The problem is that the typed dataset is looking for a table with a
particular name. After realizing how to properly use the DA's fill command
I populated the dataset with the properly named table and all worked fine.
It would be so much better if the error could be something like "Table
'<tablename> could not be found" instead of that cryptic garbage.

Microsoft, are you listening!!!!!? Can you hear me now!?


Craig Burkett


"Rajiv" <(E-Mail Removed)> wrote in message
news:146d01c3783f$66a92620$(E-Mail Removed)...
> Hi Craig,
>
> I didnt myself try it but from what I understand by a
> couple of other posts on the net is that, this is 'cos no
> rows are returned from the sql query.
>
> Check if this discussion helps:
> http://www.dotnet247.com/247referenc.../13/65881.aspx
>
> Hope it helps. If the prob persists, please make a post.
>
> Cheers!
> Rajiv
> >-----Original Message-----
> >I have a web form populated mostly with labels and I also

> have a schema file
> >that describes the columns in a dataset coming back from

> a database call. I
> >dragged a dataset control to the web page and tied it to

> the schema. After
> >doing this I went to each label and set up each control's

> databindings,
> >tying the text property to the appropriate field. To

> initially test it I
> >created a function which returns a dataset built

> dynamically in code with
> >the expected fields and field names and types. The

> returned dataset was
> >successfully bound to the fields, so after finally

> receiving info about the
> >database and the fields in the table I need to access I

> created the
> >appropriate SQL statement and got a dataset back. It

> successfuly merged
> >with the typed dataset, but when I go to call the

> Databind method on the
> >first label on the form things fail. That is when I

> get 'Index 0 is not
> >non-negative and below total rows count'. I've verified

> the types and names
> >of the fields returned and I just can't see where the mis-

> match is.
> >
> >Help!
> >Craig Burkett
> >
> >.
> >


 
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
Browser crashes with below code.What is wrong in below code. kiran Javascript 12 12-07-2011 02:38 PM
what does "if false" mean below rodchar ASP .Net 3 09-02-2009 03:01 PM
BT Total Broadband vs BT Business Total John Y UK VOIP 2 02-02-2007 09:27 AM
Group By Rows and Total Rows yonialhadeff ASP .Net Datagrid Control 1 01-23-2007 07:44 PM
Could someone scan me a picture of the below? (Read Below) starlightvoyager@yahoo.com DVD Video 1 08-28-2006 05:42 AM



Advertisments