473,387 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Index (zero based) must be greater than or equal to zero

347 100+
I have the following code:

Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head runat="server">
  7.     <title>Oncall Lookup</title>
  8.     <style type="text/css">
  9.         .style1
  10.         {
  11.             text-align: center;
  12.         }
  13.     </style>
  14. </head>
  15. <body>
  16.     <form id="form1" runat="server">
  17.     <div>
  18.  
  19.         <br />
  20.         <br />
  21.         <br />
  22.  
  23.     </div>
  24.     <div class="style1">
  25.         &nbsp;<asp:Label ID="TimeDateLabel" runat="server" style="text-align: center"></asp:Label>
  26.         <br />
  27.         <br />
  28.         <br />
  29.         <br />
  30.         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  31.         <asp:TextBox ID="schednameTextBox" runat="server" style="text-align: center"></asp:TextBox>
  32.         <asp:RequiredFieldValidator ID="schednameValidator" runat="server" 
  33.             ControlToValidate="schednameTextBox" ErrorMessage="This is a required field">This 
  34.         is a required field</asp:RequiredFieldValidator>
  35.         <br />
  36.         Schedule Name<br />
  37.         <br />
  38.         <br />
  39.         <br />
  40.         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  41.         <asp:TextBox ID="sincedateTextBox" runat="server" style="text-align: center"></asp:TextBox>
  42.         <asp:RequiredFieldValidator ID="sincedateValidator" runat="server" 
  43.             ControlToValidate="sincedateTextBox" ErrorMessage="This is a required field">This 
  44.         is a required field</asp:RequiredFieldValidator>
  45.         <br />
  46.         Since Date<br />
  47.         <br />
  48.         <br />
  49.         <asp:Button ID="whosoncallButton" runat="server" Text="Who's On Call" />
  50. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  51.         <asp:Button ID="clearButton" runat="server" Text="Clear" />
  52.         <br />
  53.         <br />
  54.         <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"  HorizontalAlign="Center"
  55.             DataSourceID="SqlDataSource1">
  56.             <Columns>
  57.                 <asp:BoundField DataField="SchedName" HeaderText="SchedName" 
  58.                     SortExpression="SchedName" />
  59.                 <asp:BoundField DataField="ActivityDate" HeaderText="ActivityDate" 
  60.                     ReadOnly="True" SortExpression="ActivityDate" />
  61.                 <asp:BoundField DataField="By" HeaderText="By" SortExpression="By" />
  62.                 <asp:BoundField DataField="Activity" HeaderText="Activity" ReadOnly="True" 
  63.                     SortExpression="Activity" />
  64.                 <asp:TemplateField HeaderText="Firstlisting" SortExpression="Firstlisting"> 
  65.     <ItemTemplate> 
  66.         <asp:HyperLink ID="Firstlisting" runat="server" Text='<%# Eval("Firstlisting") %>' 
  67.              NavigateUrl='<%# String.Format("\website1\Default3.aspx?firstlisting={2}", Eval("Firstlisting")) %>' /> 
  68.     </ItemTemplate> 
  69. </asp:TemplateField> 
  70.                 <asp:TemplateField HeaderText="OncallStart" SortExpression="OnCallStart"> 
  71.     <ItemTemplate> 
  72.         <asp:HyperLink ID="OnCallStart" runat="server" Text='<%# Eval("OncallStart") %>' 
  73.              NavigateUrl='<%# String.Format("\website1\Default2.aspx?date={0}&schedname={1}", Eval("OncallStart"), Eval("Schedname")) %>' /> 
  74.     </ItemTemplate> 
  75. </asp:TemplateField>   
  76.                 <asp:BoundField DataField="OnCallEnd" HeaderText="OnCallEnd" ReadOnly="True" 
  77.                     SortExpression="OnCallEnd" />
  78.             </Columns>
  79.         </asp:GridView>
  80.         <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
  81.             ConnectionString="<%$ ConnectionStrings:MDRConnectionString %>" 
  82.             SelectCommand="sp_getoncallresults2" SelectCommandType="StoredProcedure">
  83.             <SelectParameters>
  84.                 <asp:ControlParameter ControlID="sincedateTextBox" DbType="Datetime" 
  85.                     Name="sincedate" PropertyName="Text" />
  86.                 <asp:ControlParameter ControlID="schednameTextBox" Name="schedname" 
  87.                     PropertyName="Text" Type="String" />
  88.             </SelectParameters>
  89.         </asp:SqlDataSource>
  90.         <br />
  91.         <br />
  92.         <br />
  93.         <br />
  94.         <asp:Label ID="nodataLabel" runat="server"></asp:Label>
  95.         <br />
  96.         <br />
  97.         <br />
  98.         <br />
  99.         <br />
  100.         <br />
  101.         <br />
  102.         <br />
  103.     </div>
  104.     </form>
  105. </body>
  106. </html>
  107.  
and when I run this code I get the error.

Index (zero based) must be greater than or equal to zero and less than the size of the argument list.

and if I remove this code:

Expand|Select|Wrap|Line Numbers
  1.     <asp:TemplateField HeaderText="Firstlisting" SortExpression="Firstlisting"> 
  2.     <ItemTemplate> 
  3.         <asp:HyperLink ID="Firstlisting" runat="server" Text='<%# Eval("Firstlisting") %>' 
  4.              NavigateUrl='<%# String.Format("\website1\Default3.aspx?firstlisting={2}", Eval("Firstlisting")) %>' /> 
  5.     </ItemTemplate> 
  6. </asp:TemplateField> 
  7.  
then the error goes away. The firstlisting field, should pass it's variables to another web page, just as the other one does, but the code behind for this page, isn't asking for this variable. Can anyone please assist?

Thanks

Doug
Sep 1 '11 #1
0 949

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Boris Miloslavsky | last post by:
Hi, I have a weird problem. A regular html containing table does not display correctly in IE6. I do not see a gap between second and third columns in the header. I have a dark background and...
14
by: dam_fool_2003 | last post by:
Hai, When I declare a zero-based array I get a compile time error stating that zero based array is not possible. But if I declare the same in the function argument I don't get any error. Is...
0
by: Marcel Brekelmans | last post by:
Hi, That's what MicroSoft says about it. On the one hand it offers you an index (apparently into the EventLogEntryCollection) but you can't be sure as to which element you are retrieving!? As a...
4
by: simchajoy2000 | last post by:
Hi, I have a form containing a datagrid where users can enter in their specified information for each row and column. Behind the scenes I have a sub which handles datagrid.CurrentCellChanged...
2
by: hemant | last post by:
hello everybody, I am having a datagrid which has data regarding customers. it has a penalty column, and i want to show the entire record of the customer in red whose penalty is greater than...
13
by: HockeyFan | last post by:
I'm not sure how to exactly ask this, but expect that it's a Javascript solution. However, I'll ask the question and maybe someone can point me to some existing code that will do what I need. I...
7
by: kj | last post by:
Hi! How can I achieve zero-based numbering in ordered lists? E.g. want the list <ol> <li>larry</li> <li>curly</li> <li>moe</li> </ol> to be rendered
1
by: gomzi | last post by:
hi, When i try to select the number of rows in my table depending on a where condition i get this error : - Index (zero based) must be greater than or equal to zero and less than the size of the...
2
by: pbd22 | last post by:
Hi Folks. I have two columns, for simplicity: Input and Output. Output reflects the incremental difference of two chronolgocially consecutive inputs. problem: If a given input in the series...
6
by: Colin Kepl | last post by:
In Access, I have a table that receives data from Excel. I have a second table that has one of its fields changed based on a comparison to the first table. The update query is as follows: ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.