I'm beginner in web service and want to write simple query with LINQ to SQL and return that query result with Web Service,write this code:
[WebMethod]
public string LinqExample()
{
string conn = "Data Source=REMOVETHIS";
DataClasses1DataContext behzad = new DataClasses1DataContext(conn);
string result;
var query = (from p in behzad.CDRTABLEs
where p.name == "behzad".Trim()
select p).Take(1);
return query.ToString();
}
But when I run that web service,I get this error:
How can I solve that?
