?? DataTable? ??? ???? ???? ??
??:
??? ????? ? ??? ? ??? ?? ?? DataTable? ?? ??? ???? ???? ?? ??????.
???:
? ??? ???? ??? ???? DataTable? ????? ?? ??? ?? ??? ??? ? ????.
public static DataTable MergeAll(this IList<DataTable> tables, String primaryKeyColumn) { // Validate arguments if (!tables.Any()) throw new ArgumentException("Tables must not be empty", "tables"); if (primaryKeyColumn != null) foreach (DataTable t in tables) if (!t.Columns.Contains(primaryKeyColumn)) throw new ArgumentException("All tables must have the specified primarykey column " + primaryKeyColumn, "primaryKeyColumn"); DataTable table = new DataTable("TblUnion"); // Disable data validation during bulk loading table.BeginLoadData(); // Merge all tables into the result table foreach (DataTable t in tables) table.Merge(t, false, MissingSchemaAction.Add); // End data validation table.EndLoadData(); // Handle duplicate primary keys (if specified) if (primaryKeyColumn != null) { // Group rows by primary key column var pkGroups = table.AsEnumerable().GroupBy(r => r[primaryKeyColumn]); // Identify groups with duplicate keys var dupGroups = pkGroups.Where(g => g.Count() > 1); // Combine data from duplicate rows into the first row of each group foreach (var grpDup in dupGroups) { // Use the first row and modify it to include data from other rows DataRow firstRow = grpDup.First(); foreach (DataColumn c in table.Columns) { if (firstRow.IsNull(c)) { // Find the first non-null row for the current column and copy its value DataRow firstNotNullRow = grpDup.Skip(1).FirstOrDefault(r => !r.IsNull(c)); if (firstNotNullRow != null) firstRow[c] = firstNotNullRow[c]; } } // Remove duplicate rows var rowsToRemove = grpDup.Skip(1); foreach (DataRow rowToRemove in rowsToRemove) table.Rows.Remove(rowToRemove); } } // Return the merged table return table; }
???:
var tables = new[] { tblA, tblB, tblC }; DataTable TblUnion = tables.MergeAll("c1");
? ??? ??? ?? ??? ???? ?????. DataTables, ??? ?? ?? ? ?? ??? ??.
? ??? ??? ?? ?? ?? DataTable? ?? ???? ????? ????? ??? ?? ????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











C? ???? ?? ??? ?? ???? ?? ???? ??? ??? ?? ???? ??????. 1) ?? ??? ?? ???? ?? ??? ??? ??? ??????. 2) ?? ??? ?????? ???? ?? ? ???? ?? ?? ??? ?????. ? ????? ????? ???? ?? ???? ??? ? ??? ?? ?? ? ?? ???? ??? ?????? ???????.

?, ?? ???? C? ??? ??, ?? ??? ? ??????. 1. ?? ???? ??? ??? ?? ?? ??? ?? ?? ??? ?????. 2. ????? ??? ?? ??? ?? ??? ??? ?? ? ??? ?????. 3. ??? ???? ?? ?? ???? ???? ?? ?? ??? ??? ????? ????? ???? ?????.

C? ???? ??? ???? ??? ?????? ? ?????. 1) ???? ???? ?? ??? ?? ??? ????? ?? ? ???? ?????. 2) ?? ?? ?? ??, ?? ?? ? ?? ???? ???????. 3) ???? ??? ??? ?? RAII ??? ???? ??? ???? ??????. 4) ?? ????? ?? ???? ???? ?? ? ??? ??? ???? ????????. 5) ?? ? ?? ??? ???? ?? ?? ???? ?? ? ? ????. 6) ??? ?? ???? ???? ???? ?? ???? ??????.

1) ?? ? ?? ?? ??, 2) ?? ??? ???? ?? ???? ????, 3) ?? ???? ?? ??? ?? ??? ?? ???? 4) ?? ??? ??? ?? ??? ???? ??? ??? ??????. ???? ???? ?? ??? ??? ??? ?? ??? ??? ???? ?? ???? ?? ??? ???? ? ????.

C? ? ?? ?? ??? ??? ??? : ??? ?? ??? ? ??? ???. 1. ??? ?? ???? ?? ??? ? ???? ?? ????? ?? ??? ????? ?? ???? ??? ? ????. 2. ??? ???? ?? ?? ? ??? ?? ???? ???? ??? ?? ?? ??? ?????.

?, C? ???? ?? ?????. 1) ??? ??? ?? ?? ? ??? ???? ?????. 2) ?? ???? ???? ??? ????. 3) ?? ??? ????? ??? ?? ???? ??? ??? ? ??????. ?? ? ??? ?? ???? ???? ??? ?????? ??? ?? ?????.

C DestructorsCanleadToSeVeralCommonerrors.toaVoidthem : 1) ?? ?? ?? ?? ?? ?? ???

C? ???? ??? ??? ? ??? ?? ????? ????. 1. ??? ???? ?? ??? ?? ????? ???? ??? ??? ???? ?? ? ? ????. 2. ??? ?? ???? ?? ??? ? ???? ?? ????, ??? ???? ?????.
