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 difference between LINQ and Stored Procedures?

1 Answers  


Explain what are compiled queries?

1 Answers  


Is linq a framework?

1 Answers  


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

1 Answers  


What are linq extension methods?

1 Answers  


How to return list from linq query?

1 Answers  


What are deferred execution and immediate execution?

1 Answers  


When to use Single, SingleOrDefault, First and FirstOrDefault?

1 Answers  


What is a linq expression?

1 Answers  


How can we find sequence of items in two different array (same type) in the same order using linq query?

1 Answers  


What is defaultifempty in linq?

1 Answers  


Explain how LINQ is useful than Stored Procedures?

1 Answers  


Categories