Hi Ramón,
TrimSpaces is an option from PB but not supported by the standard SQL Server connection string.
Please make sure you are using SnapObjects.Data 2.1.0 and corresponding database provider. Then refer to the following code about how to set the TrimSpaces option in the StartUp.cs file:
public class StartUp
{
public void ConfigureServices(IServiceCollection services)
{
// UseSqlServer with connection string and other options.
services.AddDataContext<SqlServerContext>(m => m.UseSqlServer(CONNECTION_STRING, n => n.TrimSpaces = true));
}
}
BTW: after getting the next release (PB 2019 R2 MR), you will be able to set the TrimSpaces option when creating a DataContext in SnapDevelop. SnapDevelop will help you to generate additional settings in your appsettings.json file. Then you can simplify the code:
public class StartUp
{
public void ConfigureServices(IServiceCollection services)
{
// UseSqlServer with the IConfiguration object and the key specified in the connection strings.
services.AddDataContext<SqlServerContext>(m => m.UseSqlServer(this.Configuration, "MyConnectionString"));
}
Regards,
Logan