Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Index was outside the bounds of the array.

Status
Not open for further replies.

jtgurkin

Technical User
Sep 16, 2002
47
US
i'm getting the above error when i execute the databind() command. Is there a limit to the number of items that can be databound b/c if i remove one of the lines, anyone of the lines, it'll work.

Code:
<BR><%#Group_Size.Text%><BR>
<%#Church.Text%><BR>
<%#Address.Text%><BR>
<%#City.Text%><BR>
<%#State.Text%><BR>
<%#Zip.Text%><BR>
<%#Contact.Text%><BR>
<%#Contact_Email.Text%><BR>
<%#Choirs.SelectedValue%><BR>
<%#Total_Cost%><BR>
<%#Choir_One_Ringing.SelectedValue%><BR>
<%#Choir_One_Feet.Text%><BR>
<%#Choir_Two_Ringing.SelectedValue%><BR>
<%#Choir_Two_Feet.Text%><BR>
<%#Special_Requests.Text%><BR>
<%#Parade_Director.Text%><BR>
<%#Group_Name.Text%><BR>
<%#Parade_Directors_Email.Text%><BR>
<%#Parade_Selection.Text%><BR>
<%#Parade_Composer.Text%><BR>
<%#Parade_Publisher.Text%><BR>
<%#Parade_Order_Number.Text%><BR>
<%#First_Choice_Rehearsal_A%><BR>
<%#Second_Choice_Rehearsal_A%><BR>

<%#Third_Choice_Rehearsal_A%>
 
jt: Sounds like an array has a declared Upperbound - make sure the number of elements in the SQL are identical with the number of binding elements (beginning at 0) - and this may not be the issue, but worth a check.
 
The only problem is that these are databound to page controls not a SQL Connection.
 
Thanks jt - sure, they're getting their values from the form's textboxes, my first impression was that perhaps not all of the textboxes might be populated, and whether, e.g., a NULL might be inteferring, etc..

This brings up a good question jt, if in a case of simple binding an 'Index out of bounds' err is thrown. I'm fairly familiar with ADO.NET but not quite sure what may be going on here, it should be obvious enough for some one dropping by.

I assume we're talking about a form, with the above textboxes, which may at first appear Null, with user entry populating some, but not all of the texboxes -- or a close variation of this.

This is a good time for me to post the following question, which I have, q.v., compare and contrast the following two databinding techniques:

<%# myText.Text %> and '<%= istrMyString%>'

And of course, jt's question of how an apparent out of bounds array enters into the equation (jt - currently away from office so limited here to test).





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top