title: C# fetch data using Linq to Sql
body: <p>I am new to <code>C# Linq</code>. I am running a restful service and for that I need to implement a function, and after that using that function I want to call my <code>Webservice</code> and <code>WebClient</code> as well,<br>
  I want to use database <strong>Student</strong>, please tell me some suggestion, or the function code so that I may fetch data from SQL,</p>
  
  <p>Either I have to add a <code>LinqtoSQl</code> file in my service project or I may achieve my Goal using Just a Function.<br>
  Please Help,<br>
  My Student table has following columns,</p>
  
  <pre><code>ID  
  FirstName  
  LastName  
  Email  
  DOB  
  Religion  
  Studentof  
  ContactNumber  
  Address  
  AdmissionDate  
  </code></pre>
  
  <p>for being Simple:
  you may code for the following SQL Query,</p>
  
  <blockquote>
    <p>Select * from Student where FirstName="Myname";</p>
  </blockquote>
  
  <pre><code>[OperationContract]
  [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "linq/?id={id}")]
  string linq(string id);    
  public string linq(string id) 
  {
      return "This function should return Linq to SQL Result" + id;
  }
  </code></pre>