public List<EventEntity> GetCurrentUpComingEventsByEstate(string EstName)
{
EventDBModelDataContext context = new EventDBModelDataContext();
var res = from e in context.EventEntities
where e.eventDate >= DateTime.Now  _estatename(?)
select e;
return res.ToList();
}

Hi experts,
How do i declare the estatename part so that when i test the program in web browser, i will only get the details of the estatename that i choose based on the date and the estatename?

Recommended Answers

All 4 Replies

If the variable "estatename" is part of "context" then:

...
where
   e.eventDate >= DateTime.Now
   && e.estatename.Equals(EstName)
...

Hi, thanks for the coding. however why when i test it on the web service, the response is endpoint not found. what could be the possible reasons ?

[OperationContract]
[WebInvoke(UriTemplate = "GetCurrentUpComingEventsByEstate?estateName=EstName",
RequestFormat = WebMessageFormat.Xml,
ResponseFormat = WebMessageFormat.Xml)]
List<EventEntity> GetCurrentUpComingEventsByEstate(string EstName);


public List<EventEntity> GetCurrentUpComingEventsByEstate(string EstName)
{
EventDBModelDataContext context = new EventDBModelDataContext();
var res = from e in context.EventEntities
where e.eventDate >= DateTime.Now
&& e.estateName.Equals(EstName)
select e;
return res.ToList();
}

This is my codes. But the endpoint is not found when i tried to run it in web browser. Can someone pls help ?

Is your service turned "ON" in IIS?
Did you activate the service in the web server so it could be found?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.