Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Item cannot be found in the collection corresponding to the requested name or ordinal.

Reply
Thread Tools

Item cannot be found in the collection corresponding to the requested name or ordinal.

 
 
Vinod
Guest
Posts: n/a
 
      02-23-2005

"Dthmtl" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I know what this error is, all fieldnames have been verified and

reverified.
> Not sure why it is happening.
>
> Here is the SQL statement
>
> strSQL = "SELECT Problems.TicketNumber, Activity, ActDate FROM Problems

LEFT
> JOIN Resolutions ON Problems.TicketNumber = Resolutions.TicketNumber WHERE
> Problems.TicketNumber = " & Ticket & " ORDER BY ActDate DESC;"
>
> <td><% = rs("Problems.TicketNumber") %></td>
>
>
>
>


Hi,

enclose Problems.TicketNumber like this [Problems.TicketNumber] in the sql
statement.
Also try <%=rs(0)%>

regards
vinod


 
Reply With Quote
 
 
 
 
Dthmtl
Guest
Posts: n/a
 
      02-23-2005
I know what this error is, all fieldnames have been verified and reverified.
Not sure why it is happening.

Here is the SQL statement

strSQL = "SELECT Problems.TicketNumber, Activity, ActDate FROM Problems LEFT
JOIN Resolutions ON Problems.TicketNumber = Resolutions.TicketNumber WHERE
Problems.TicketNumber = " & Ticket & " ORDER BY ActDate DESC;"

<td><% = rs("Problems.TicketNumber") %></td>




 
Reply With Quote
 
 
 
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      02-23-2005
It'd just be called TicketNumber. Or better, use:

<td><%=rs.Fields.Item(0).Value%></td>

Ray at work

"Dthmtl" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I know what this error is, all fieldnames have been verified and

reverified.
> Not sure why it is happening.
>
> Here is the SQL statement
>
> strSQL = "SELECT Problems.TicketNumber, Activity, ActDate FROM Problems

LEFT
> JOIN Resolutions ON Problems.TicketNumber = Resolutions.TicketNumber WHERE
> Problems.TicketNumber = " & Ticket & " ORDER BY ActDate DESC;"
>
> <td><% = rs("Problems.TicketNumber") %></td>
>
>
>
>



 
Reply With Quote
 
Iain Norman
Guest
Posts: n/a
 
      02-24-2005
On Wed, 23 Feb 2005 15:20:44 -0500, "Dthmtl" <(E-Mail Removed)> wrote:

>I know what this error is, all fieldnames have been verified and reverified.
>Not sure why it is happening.
>
>Here is the SQL statement
>
>strSQL = "SELECT Problems.TicketNumber, Activity, ActDate FROM Problems LEFT
>JOIN Resolutions ON Problems.TicketNumber = Resolutions.TicketNumber WHERE
>Problems.TicketNumber = " & Ticket & " ORDER BY ActDate DESC;"
>
><td><% = rs("Problems.TicketNumber") %></td>
>
>
>

Response.Write the resulting strSQL to make sure there's nothing silly
about it, usually that makes the mistake apparent in my experience.

--
Iain Norman | http://www.eliteforum.org
 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      02-24-2005
You forgot to check field names by dumping rs(i).Name for each field.

Actually ADO uses the Table.Name notation only if there is a conflict. Else
it uses just the field name i..e. TicketNumber...

Patrice

--

"Dthmtl" <(E-Mail Removed)> a écrit dans le message de
news:(E-Mail Removed)...
> I know what this error is, all fieldnames have been verified and

reverified.
> Not sure why it is happening.
>
> Here is the SQL statement
>
> strSQL = "SELECT Problems.TicketNumber, Activity, ActDate FROM Problems

LEFT
> JOIN Resolutions ON Problems.TicketNumber = Resolutions.TicketNumber WHERE
> Problems.TicketNumber = " & Ticket & " ORDER BY ActDate DESC;"
>
> <td><% = rs("Problems.TicketNumber") %></td>
>
>
>
>



 
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
Collection problems (create Collection object, add data to collection, bind collection to datagrid) Řyvind Isaksen ASP .Net 1 05-18-2007 09:24 AM
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
Item cannot be found in the collection corresponding to the requested name or ordinal CJM ASP General 2 11-09-2004 04:43 PM
[SQL] Selecting item from table, whether or not it has corresponding entry in 2nd table... Augustus ASP General 3 02-05-2004 02:45 AM
Field name is valid, but getting an "Item cannot be found.." error J. Muenchbourg ASP General 5 09-27-2003 05:26 AM



Advertisments