title: Linq to SQL search for wildcard in double
body: <p>In a Linq to SQL I am trying to search for a value of the type double:</p>
  
  <pre><code>var q = from a in db.GetTable&lt;HKKS_Medlemmer&gt;()
              from g in db.HKKS_Get_grader_Kun_Grad(Convert.ToInt32(a.Skif))
              where a.Aktiv == true &amp;&amp;
               (a.Skif.ToString().StartsWith(SearchValue) ||
               SqlMethods.Like(a.Navn, "%" + SearchValue + "%") ||
                SqlMethods.Like(a.Mellemnavn, "%" + SearchValue + "%") ||
                SqlMethods.Like(a.Efternavn, "%" + SearchValue + "%") ||
                SqlMethods.Like(a.Adresse, "%" + SearchValue + "%") ||
                SqlMethods.Like(a.Telefon, "%" + SearchValue + "%") ||
                SqlMethods.Like(a.Mobil, "%" + SearchValue + "%") ||
                SqlMethods.Like(a.PostNr, "%" + SearchValue + "%") ||
                SqlMethods.Like(a.town, "%" + SearchValue + "%") ||
                SqlMethods.Like(a.mail, "%" + SearchValue + "%"))
              orderby a.Navn
  select new
              {
                  Grad = g.Grad,
                  Skif = a.Skif,
                  Navn = a.Navn,
                  Mellemnavn = a.Mellemnavn,
                  Efternavn = a.Efternavn,
                  Adresse = a.Adresse,
                  Telefon = a.Telefon,
                  Mobil = a.Mobil,
                  PostNr = a.PostNr,
                  town = a.town,
                  mail = a.mail,
                  Picture = "http://www.hkks.dk/" + a.Picture,
                  Age = db.fn_GetAge((a.CPR), DateTime.Now),
                  Cpr = a.CPR
  
              };
  </code></pre>
  
  <p>I have also tried this:</p>
  
  <pre><code>var u = from a in db.GetTable&lt;HKKS_Medlemmer&gt;()
                  from g in db.HKKS_Get_grader_Kun_Grad(Convert.ToInt32(a.Skif))
                  .Where  (p =&gt; Object.Equals(a.Skif, SearchValue))
                  orderby a.Navn
                  select new
                  {
                      Grad = g.Grad,
                      Skif = a.Skif,
                      Navn = a.Navn,
                      Mellemnavn = a.Mellemnavn,
                      Efternavn = a.Efternavn,
                      Adresse = a.Adresse,
                      Telefon = a.Telefon,
                      Mobil = a.Mobil,
                      PostNr = a.PostNr,
                      town = a.town,
                      mail = a.mail,
                      Picture = "http://www.hkks.dk/" + a.Picture,
                      Age = db.fn_GetAge((a.CPR), DateTime.Now),
                      Cpr = a.CPR
  
                  };
  </code></pre>
  
  <p>But none of them is giving me the correct result, if i am searching for 994 and expecting the result to give me the record of 99469.</p>
  
  <p>Any suggestions?</p>