/ Home / HowTo / UpdateWithKeys

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

Key columns can only create a simple where clause with "and" and "=" as in:
where column1 = 1
and column2 = "Something"

For more complex where clauses, use Filters.

using LJCDBClientLib;
using LJCNetCommon;
using System.Collections.Generic;

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

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

  // Select the records and properties to be updated.
  var keyColumns = new DbColumns()
  {
    { "ID" , province.ID }
  };
  var propertyNames = new List()
  {
    { "Description" },
  };

  // Perform the Update
  sqlManager.Update(province, keyColumns, propertyNames);
}
/ Home / HowTo / UpdateWithKeys

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