SPListItemCollection Error

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 = (fromi inditems.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

July 18th, 2013 4:25am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics