public static void Main()
DataSet dataSet = new DataSet();
DataTable dataTable = new DataTable();
dataTable.Columns.Add("PartNumber", typeof(string));
dataTable.Columns.Add("Description", typeof(string));
DataRow row = dataTable.NewRow();
row["PartNumber"] = "P1";
row["Description"] = "Part 01";
row = dataTable.NewRow();
row["PartNumber"] = "P2";
row["Description"] = "Part 02";
dataSet.Tables.Add(dataTable);
foreach (DataTable table_ in dataSet.Tables)
Console.WriteLine("^^^^^^^^^^^^^^^^^");
foreach (DataRow row_ in table_.Rows)
string partNum = (System.String)row_["PartNumber"];
string partDesc = (System.String)row_["Description"];
Console.WriteLine($"Kode Material: {partNum}");
Console.WriteLine($"Nama Material: {partDesc}");
Console.WriteLine("-------------------");
string jsonString = "{\"Carts\":[{\"PartNum\":\"FG001\",\"Quantity\":2,\"UnitPrice\":1000},{\"PartNum\":\"FG002\",\"Quantity\":4,\"UnitPrice\":2000},{\"PartNum\":\"FG003\",\"Quantity\":5,\"UnitPrice\":1500}]}";
DataSet cartsDs = JsonConvert.DeserializeObject<DataSet>(jsonString);
foreach (DataTable carts in cartsDs.Tables)
Console.WriteLine("###############");
foreach (DataRow cart in carts.Rows)
string partNum = (System.String)cart["PartNum"];
long quantity = (System.Int64)cart["Quantity"];
long unitPrice = (System.Int64)cart["UnitPrice"];
Console.WriteLine($"PartNum: {partNum}");
Console.WriteLine($"Quantity: {quantity}");
Console.WriteLine($"UnitPrice: {unitPrice}");
Console.WriteLine(">>>>>>>>>>>>>");