Wednesday, September 25, 2013

Cannot resolve the collation conflict In LINQ

Cannot resolve the collation conflict IN LINQ Can be resolved using AsEnumerable() with Table Like as mention below



 DataClassesDataContext tdc = new DataClassesDataContext();

        var  warid = (from id in tdc.SP_Cases.AsEnumerable()
                      join defe in tdc.Defendant_Masters.AsEnumerable() on id.WarrantID   equals defe.WarrantID
                      join defAd in tdc.Defendant_Addresses.AsEnumerable() on defe.CID equals defAd.Def_Id
                     where id.WarrantID == "SPC1080"
                     select new { id.WarrantID, id.JudgCost, id.EntryDate,defe.DefendantName,defAd.Add1 }).FirstOrDefault();

        if (warid != null)
        {
            Label1.Text = warid.WarrantID;
            Label2.Text = warid.JudgCost.ToString();
            Label3.Text = warid.DefendantName;
            Label4.Text = warid.Add1;
        }

No comments:

Post a Comment