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 the benefit of using linq in dataset?
what is the difference between Skip() and SkipWhile() extension method?
Explain what is the extension of the file, when LINQ to SQL is used?
Explain what are compiled queries?
Explain what is the difference between statement lambda and expression lambda?
Is not supported in linq to entities?
What are the benefits of tier architecture style?
Is linq faster than foreach?
what is the difference between Statement Lambda and Expression Lambda?
What is difference between linq and entity framework?
What are important features linq?
What are Quantifiers?
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)