B-Arts DocumentationIndice generale

BDataTable - Esempi

Caricamento modificabile

using B.BData;
using System.Data;

using BConnection connection = new BConnection(GetDatabaseSetting());
using BDataTable systems = new BDataTable(
  "BSP_sysSistemi_SEARCH",
  connection,
  CommandType.StoredProcedure);

foreach (DataRow row in systems.Rows)
{
  string description = row["Descrizione"].ToString() ?? "";
}

Aggiornamento

if (systems.Rows.Count > 0)
{
  systems.Rows[0]["Descrizione"] = "Descrizione aggiornata";
  int affectedRows = systems.Update();
}

Usare Update soltanto quando la tabella è stata caricata in modalità modificabile e dispone delle informazioni necessarie al relativo DataAdapter. Per consultazioni senza aggiornamento, preferire un overload in sola lettura.