Файл JSON состоит из 2 частей (вложенных), и я просто могу импортировать первую, не знаю почему, есть идеи для этого?Первый столбец второй части показал мне NULL
в базе данных
Это формат файла JSON:
Мой код :
public override void CreateNewOutputRows()
{
/*
Add rows by calling the AddRow method on the member variable named "<Output Name>Buffer".
For example, call MyOutputBuffer.AddRow() if your output was named "MyOutput".
*/
String jsonFileContent = File.ReadAllText(@"C:\Json XLM project SSIS\FileSample.JSON");
JavaScriptSerializer js = new JavaScriptSerializer();
List<Order> orders = js.Deserialize<List<Order>>(jsonFileContent);
foreach (Order order in orders)
{
Output0Buffer.AddRow();
Output0Buffer.TrackingNumber = order.TrackingNumber;
Output0Buffer.LocalReferenceNumber = order.LocalReferenceNumber;
Output0Buffer.TotalShipmentPieces = order.TotalShipmentPieces;
Output0Buffer.TotalShipmentValue = order.TotalShipmentValue;
Output0Buffer.ShipmentCurrency = order.ShipmentCurrency;
Output0Buffer.ShipmentGrossWeight = order.ShipmentGrossWeight;
Output0Buffer.ShipmentNetWeight = order.ShipmentNetWeight;
Output0Buffer.BorderTransportMode = order.BorderTransportMode;
Output0Buffer.ConveyanceDetail = order.ConveyanceDetail;
Output0Buffer.TransportId = order.TransportId;
Output0Buffer.Region = order.Region;
Output0Buffer.WarehouseLocation = order.WarehouseLocation;
Output0Buffer.InvoiceNumber = order.InvoiceNumber;
Output0Buffer.InvoiceDate = order.InvoiceDate;
Output0Buffer.ItemCategoryId = order.ItemCategoryId;
Output0Buffer.InsuredValue = order.InsuredValue;
Output0Buffer.SoldByShipmentPartyAddressId = order.SoldByShipmentPartyAddressId;
}
}
Заранее спасибо.