Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Ordinalator
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Data; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here DataTable dt=new DataTable(); dt.Columns.Add("a",typeof(System.Int32)); dt.Columns.Add("b",typeof(System.Int32)); dt.Columns.Add("TDS",typeof(System.Int32),"(a*b)*b"); dt.Rows.Add(new object[] {1,2}); DataTable dt_OldColumnOrdinals = new DataTable(); dt_OldColumnOrdinals.Columns.Add("rn",typeof(System.Int32)); dt_OldColumnOrdinals.Columns.Add("name",typeof(System.String)); dt_OldColumnOrdinals.Rows.Add(new object[] {0,"b"}); dt_OldColumnOrdinals.Rows.Add(new object[] {1,"a"}); foreach(DataRow dr_OldColumnOrdinals in dt_OldColumnOrdinals.Rows) { var oldOrdinal = dt.Columns[dr_OldColumnOrdinals["name"].ToString()].Ordinal; dt.Columns[dr_OldColumnOrdinals["name"].ToString()].SetOrdinal(Convert.ToInt32(dr_OldColumnOrdinals["rn"])); dr_OldColumnOrdinals["rn"] = oldOrdinal; } string d=""; foreach(DataRow dr in dt.Rows) { d+="\n"; foreach(DataColumn dc in dt.Columns) { d+="\t"; d+=dr[dc].ToString(); } } Console.WriteLine("Hello, world!\n"+d); } } }
run
|
edit
|
history
|
help
0
C# enum flag comparison with bitwise operators
dynamic in C#
Hello world
Bases5
a
ternary function
value tuple
TEst1
modified
Huffman Algorithm