Generate nested JSON file with DataTable using C# and VB.Net in ASP.Net

Last Reply one month ago By dharmendr

Posted one month ago

How to make this type of Json file in vb.net using datatable

{
"version":"1.0.1118",
"billLists":[{
"userGstin":"24AHHPS5702M1Z3",
"supplyType":"O",
"subSupplyType":1,
"docType":"BIL",
"docNO":"R000008/2021",
"docDate":"12/05/2020",
"transType":1,
"fromGstin":"24AHHPS5702M1Z3",
"fromTrdName":"abc",
"fromAddr1":"abc",
"fromAddr2":"abc",
"fromPlace":"ahmedabad",
"fromPincode":380001,
"fromStateCode":24,
"actualFromStateCode":24,
"toGstin":"",
"toTrdName":"abc",
"toAddr1":"",
"toAssr2":"AHMEDABAD",
"toPlace":"",
"toPincode":,
"toStateCode":24,
"actualToStateCode":24,
"totalValue":28.00,
"cgstValue":1.50,
"sgstValue":1.50,
"igstValue":0.00,
"cessValue":0.00,
"TotNonAdvolVal":0,
"OthValue":0.00,
"totInvValue":28.00,
"transMode":1,
"transDistance":50,
"vehicleNo":"",
"vehicleType":"R",
"mainHsnCode":121211,
"itemList":[
{
"itemNo":1,
"ProductName":"99",
"productDesc":"99",
"hsnCode":121211,
"quantity":1.00,
"qtyUnit":"PCS",
"taxableAmount":25.00,
"sgstRate":6.00,
"cgstRate":6.00,
"igstRate":0.00,
"cessRate":0.00,
"CessNonAdvol":0
}
]
}
]
}

 

Posted one month ago
Hi @kas12345,
Please try the following

Create JSON file from DataSet (DataTable) using C# and VB.Net in ASP.Net

It might help you.

Cheers Andrea.