Write a program for concat to create one sequence of data rows that contains datatabless data rows, one after the other?
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 |
What is difference between LINQ and Stored Procedures?
Explain what are compiled queries?
Is linq a framework?
Write a program for concat to create one sequence of data rows that contains datatabless data rows, one after the other?
What are linq extension methods?
How to return list from linq query?
What are deferred execution and immediate execution?
When to use Single, SingleOrDefault, First and FirstOrDefault?
What is a linq expression?
How can we find sequence of items in two different array (same type) in the same order using linq query?
What is defaultifempty in linq?
Explain how LINQ is useful than Stored Procedures?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)