Using the .NET library

To use the .NET library you first need to install powerLoad (bcpToolkit) on your development machine.
The library contains all the API’s to create your own BCP-package.

It requires your project targeting at least .NET framework 4.5 !

Install powerLoad (bcpToolkit) on customer machine

When shipping the binaries of your project to the customer, also the customers machine requires a powerLoad (bcpToolkit) installation.
Therefore delivering the bcpDevKit assembly within your project should be avoided, so that new bcpDevKit versions can continue to be easily updated at the customer’s site.

See the complete example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using System;
using bcpDevKit;
using bcpDevKit.Entities;

namespace HelloWorldPackage
{
	class Program
	{
	        static void Main(string[] args)
	        {
	                var bcpSvcBuilder = new BcpServiceBuilder();
	                bcpSvcBuilder.Version = BcpVersion._2020;
	                bcpSvcBuilder.SetPackageLocation("C:\\Temp\\HelloWorldPackage");

	                var bcpService = bcpSvcBuilder.Build();

	                var file = bcpService.FileService.AddFile("$/HelloWorldFiles/Hello.iam", @"C:\HelloWorldFiles\Hello.iam");
	                var item = bcpService.ItemService.AddItem("999", "World", "Title 999", "Desc 999");

	                bcpService.Flush();
	        }
	}
}