Title: how to Linq To DataSet                                 If you need copy same format use firefox or chrome or safari but iexplorer not work


Preview of Code
Join Between two Tables
 
DataTable DT1 = FillDatset("select * from country_Master");
DataTable DT2 = FillDatset("select * from State_Master");
 
          var List = (from DtCountry in DT1.AsEnumerable()
                           join DtState in DT2.AsEnumerable()
                           on DtCountry.Field<int>("CountryID")
                           equals DtState.Field<int>("CountryID") into DTALL
                           from _dtAll in DTALL.DefaultIfEmpty()
                           select new
                            {
                               CountryID = DtCountry.Field<int>("CountryID"),
                               StateName = (_dtAll != null) ?
                                                   _dtAll.Field<string>("StateName") :
                                                     string.Empty
                             }
                           ).ToList();
 
          var List1 = (from DtCountry in DT1.AsEnumerable()
                            join DtState in DT2.AsEnumerable()
                            on DtCountry.Field<int>("CountryID")
                            equals DtState.Field<int>("CountryID") into DTALL
                            from _dtAll in DTALL.DefaultIfEmpty()
                            select _dtAll).ToList();