Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Write a program for concat to create one sequence of data rows that contains datatabless data rows, one after the other?



Write a program for concat to create one sequence of data rows that contains datatabless data rows, ..

Answer / Poojatyagi

{"C# LINQ example using Concat method:n```csharpnvar dataTable1 = new DataTable(); // data table 1nvar dataTable2 = new DataTable(); // data table 2nDataRow[] rows1 = { dataTable1.NewRow(), dataTable1.NewRow() }; // creating some sample rows for data table 1nDataRow[] rows2 = { dataTable2.NewRow(), dataTable2.NewRow() }; // creating some sample rows for data table 2nrows1[0]["Column1"] = "Value1"; rows1[0]["Column2"] = "Value2"; // setting values for the first row of data table 1nrows1[1]["Column1"] = "Value3"; rows1[1]["Column2"] = "Value4"; // setting values for the second row of data table 1nrows2[0]["Column1"] = "Value5"; rows2[0]["Column2"] = "Value6"; // setting values for the first row of data table 2nrows2[1]["Column1"] = "Value7"; rows2[1]["Column2"] = "Value8"; // setting values for the second row of data table 2ndataTable1.Rows.AddRange(rows1); // adding rows to data table 1ndataTable2.Rows.AddRange(rows2); // adding rows to data table 2nvar combinedData = dataTable1.AsEnumerable().Concat(dataTable2.AsEnumerable());n```}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More LINQ Language-Integrated Query Interview Questions

What is the benefit of using linq in dataset?

1 Answers  


what is the difference between Skip() and SkipWhile() extension method?

1 Answers  


Explain what is the extension of the file, when LINQ to SQL is used?

1 Answers  


Explain what are compiled queries?

1 Answers  


Explain what is the difference between statement lambda and expression lambda?

1 Answers  


Is not supported in linq to entities?

1 Answers  


What are the benefits of tier architecture style?

1 Answers  


Is linq faster than foreach?

1 Answers  


what is the difference between Statement Lambda and Expression Lambda?

1 Answers  


What is difference between linq and entity framework?

1 Answers  


What are important features linq?

1 Answers  


What are Quantifiers?

1 Answers  


Categories