/ Home / HowTo / UpdateWithFilters

How to Configure DataAccess with ConnectionBuilder.
How to Configure DataAccess with DataConfigs.

using LJCDBClientLib;
using LJCDBMessage;
using System.Collections.Generic;

// Updating data with Filters using the SQLManager object.
internal void UpdateWithFilters(Province province, string connectionString, string providerName)
{
  // Create the SQLManager.
  var sqlManager = new SQLManager(null, "Province", connectionString
    , providerName);

  // Change Values
  province.Description = "-null";

  // Select the records and properties to be updated.
  var conditionSet = new DbConditionSet();
  // Where ID > 0
  conditionSet.Conditions.Add("ID", "0", ">");
  var filters = new DbFilters()
  {
    { "ID", conditionSet }
  };
  var propertyNames = new List()
  {
    { "Description" },
  };

  // Perform the Update
  sqlManager.Update(province, null, propertyNames, filters);
}
/ Home / HowTo / UpdateWithFilters

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.