Hi You need to check, if attribute value is null. e.g string bedrooms = attr == null ? "N/A" : attr.Content;
Thanks On Jun 10, 2:44 pm, Surya <sury...@gmail.com> wrote: > HI, thanks for the reply. In the last line ie. string bedrooms = > attr.Content; > > it is showing error as Object reference not set to an instance of the > oject. Can you please tell me how to correct this? > > Thanks. > > On Jun 10, 1:04 pm, usman <usm...@gmail.com> wrote: > > > > > string address=""; > > GBaseService service = new GBaseService( > > "Google-Tutorial-1.0", this.GoogleBaseKey); > > GBaseQuery query = new > > GBaseQuery(GBaseUriFactory.Default.SnippetsFeedUri); > > query.GoogleBaseQuery = " [item type: Housing][listing > > type:for sale][location : \"" + address + "\"]"; > > > query.Refine = true; > > query.StartIndex = 0; > > query.NumberToRetrieve = 25; > > query.Content = "geocodes"; > > > GBaseFeed feed = null; > > try > > { > > feed = service.Query(query); > > } > > > foreach (GBaseEntry entry in feed.Entries) > > { > > > GBaseAttribute attr = > > entry.GBaseAttributes.GetAttribute("bedrooms"); > > string bedrooms = attr.Content; > > > } > > > On Jun 10, 10:37 am, Surya <sury...@gmail.com> wrote: > > > > Hi, > > > > Can anyone send me the code to build a sample application to search > > > for real estate information so that when an address is given as > > > parameter, it should return the search data as string or XML. > > > I need to do a C# application using Google Base API. > > > > Thanks.- Hide quoted text - > > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Google Base Data API" group. To post to this group, send email to google-base-data-...@googlegroups.com. To unsubscribe from this group, send email to google-base-data-api+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-base-data-api?hl=en.