Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

SPListItemCollection Error

$
0
0

Hi All,

Please find my code:

public

IEnumerable<IGeneric> GetVenueRooms(intvenueid)

        {

           

SPListdlist = CurrentWeb.Lists["VenueRooms"];

           

SPQueryquery =newSPQuery();

            query.Query =

string.Format(string.Concat("<Where><Eq><FieldRef Name='Venue' />",

                                                     

"<Value Type='Number'>{0}</Value></Eq></Where>"), venueid);

           

SPListItemCollectionditems = dlist.GetItems(query);           

           

vardt = (fromiinditems.Cast<SPListItem>()

                       

selectnewmGeneric


                        {

                            Title = i[

"Title"].ToString()

                        });

           

returndt.ToArray();

        }

Simple method to return a collection of items to populate into combobox. I was used this procedure quite a lot but don't particularly for this project I've been getting error in SPListItemCollection.

This works firsttime when page loads and next time onwaords whenever I change selected index in combobox then it giving me error.

Please help me on this. It is making me very frustration.

Thanks in advance.

Regards,

Rama


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>