Class DataHelper

Implements helper methods for the storage data.

Inheritance
System.Object
DataHelper
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.Commerce.Storage
Assembly: Mediachase.Commerce.dll
Version: 10.8.0
Syntax
public static class DataHelper

Methods

CreateDataReader(DataTable, String)

Creates the data reader.

Declaration
public static IDataReader CreateDataReader(DataTable sourceTable, string filter)
Parameters
Type Name Description
System.Data.DataTable sourceTable

The source table.

System.String filter

The filter.

Returns
Type Description
System.Data.IDataReader

CreateDataView(DataTable, String)

Creates the data view.

Declaration
public static DataView CreateDataView(DataTable sourceTable, string filter)
Parameters
Type Name Description
System.Data.DataTable sourceTable

The source table.

System.String filter

The filter.

Returns
Type Description
System.Data.DataView

GetDataRows(DataTable, String)

Gets the data rows based on filter.

Declaration
public static DataRow[] GetDataRows(DataTable sourceTable, string filter)
Parameters
Type Name Description
System.Data.DataTable sourceTable

The source table.

System.String filter

The filter.

Returns
Type Description
System.Data.DataRow[]

MapTables(String[])

Maps the tables.

Declaration
public static DataTableMapping[] MapTables(params string[] names)
Parameters
Type Name Description
System.String[] names

The names.

Returns
Type Description
System.Data.Common.DataTableMapping[]

MapTables2(String[], String[])

Maps the tables.

Declaration
public static DataTableMapping[] MapTables2(string[] dbNames, string[] dataSetNames)
Parameters
Type Name Description
System.String[] dbNames

The names.

System.String[] dataSetNames

The data set names.

Returns
Type Description
System.Data.Common.DataTableMapping[]

PopulateParamsFromColumns(ref DataCommand, DataColumnCollection)

Populates the params from columns.

Declaration
public static void PopulateParamsFromColumns(ref DataCommand command, DataColumnCollection columns)
Parameters
Type Name Description
DataCommand command

The command.

System.Data.DataColumnCollection columns

The columns.

SaveDataSetSimple(DataCommand, DataSet, DataViewRowState, String[])

Saves the data set simple.

Declaration
[Obsolete("This method is intended for internal use only. Use SaveDataSetSimple(DataCommand, DataSet, string[]). Will remain at least until November 2016.")]
public static void SaveDataSetSimple(DataCommand cmd, DataSet set, DataViewRowState state, params string[] tables)
Parameters
Type Name Description
DataCommand cmd

The cmd.

System.Data.DataSet set

The set.

System.Data.DataViewRowState state

The state.

System.String[] tables

The tables.

SaveDataSetSimple(DataCommand, DataSet, String[])

Saves the data set simple.

Declaration
public static void SaveDataSetSimple(DataCommand cmd, DataSet set, params string[] tables)
Parameters
Type Name Description
DataCommand cmd

The CMD.

System.Data.DataSet set

The set.

System.String[] tables

The tables.

SaveDataSetSimple(MetaDataContext, DataCommand, DataSet)

Saves the data set simple.

Declaration
[Obsolete("The MetaDataContext argument is ignored. Use SaveDataSetSimple(DataCommand, DataSet). Will remain at least until November 2016.")]
public static void SaveDataSetSimple(MetaDataContext context, DataCommand cmd, DataSet set)
Parameters
Type Name Description
MetaDataContext context

The context.

DataCommand cmd

The CMD.

System.Data.DataSet set

The set.

SaveDataSetSimple(MetaDataContext, DataCommand, DataSet, DataViewRowState)

Saves the data set simple.

Declaration
[Obsolete("This method is intended for internal use only. Use SaveDataSetSimple(DataCommand, DataSet). Will remain at least until November 2016.")]
public static void SaveDataSetSimple(MetaDataContext context, DataCommand cmd, DataSet set, DataViewRowState state)
Parameters
Type Name Description
MetaDataContext context

The context.

DataCommand cmd

The CMD.

System.Data.DataSet set

The set.

System.Data.DataViewRowState state

The state.

SaveDataSetSimple(MetaDataContext, DataCommand, DataSet, DataViewRowState, String[])

Saves the data set simple.

Declaration
[Obsolete("This method is intended for internal use only. Use SaveDataSetSimple(DataCommand, DataSet, string[]). Will remain at least until November 2016.")]
public static void SaveDataSetSimple(MetaDataContext context, DataCommand cmd, DataSet set, DataViewRowState state, params string[] tables)
Parameters
Type Name Description
MetaDataContext context

The context.

DataCommand cmd

The CMD.

System.Data.DataSet set

The set.

System.Data.DataViewRowState state

The state.

System.String[] tables

The tables.

SaveDataSetSimple(MetaDataContext, DataCommand, DataSet, String[])

Saves the data set simple.

Declaration
[Obsolete("The MetaDataContext argument is ignored. Use SaveDataSetSimple(DataCommand, DataSet, string[]). Will remain at least until November 2016.")]
public static void SaveDataSetSimple(MetaDataContext context, DataCommand cmd, DataSet set, params string[] tables)
Parameters
Type Name Description
MetaDataContext context

The context.

DataCommand cmd

The CMD.

System.Data.DataSet set

The set.

System.String[] tables

The tables.

SaveDataTableAndDeleteMetaObjects(MetaDataContext, String, DataTable, String)

Saves the specified table, and deletes any metaobjects associated with deleted rows.

Declaration
[Obsolete("Use SaveTableSimple(DataCommand, DataTable). Will remain at least until November 2016.", true)]
public static void SaveDataTableAndDeleteMetaObjects(MetaDataContext context, string connectionString, DataTable table, string metaClassIdColumnName)
Parameters
Type Name Description
MetaDataContext context

The meta data context to use for deleting meta objects.

System.String connectionString

The connection string to use for saving the data table.

System.Data.DataTable table

The data table to save.

System.String metaClassIdColumnName

The name of a column in the table that contains the meta class id.

SaveTableSimple(DataCommand, DataTable)

Saves the table simple.

Declaration
public static DataResult SaveTableSimple(DataCommand cmd, DataTable table)
Parameters
Type Name Description
DataCommand cmd

The CMD.

System.Data.DataTable table

The table.

Returns
Type Description
DataResult

SaveTableSimple(DataCommand, DataTable, DataRow[])

Saves the table simple.

Declaration
public static DataResult SaveTableSimple(DataCommand cmd, DataTable table, DataRow[] rows)
Parameters
Type Name Description
DataCommand cmd

The CMD.

System.Data.DataTable table

The table.

System.Data.DataRow[] rows

The rows.

Returns
Type Description
DataResult

SaveTableSimple(DataCommand, DataTable, DataViewRowState)

Saves the table simple.

Declaration
[Obsolete("This method is intended for internal use only. Use SaveTableSimple(DataCommand, DataTable). Will remain at least until November 2016.")]
public static DataResult SaveTableSimple(DataCommand cmd, DataTable table, DataViewRowState state)
Parameters
Type Name Description
DataCommand cmd

The CMD.

System.Data.DataTable table

The table.

System.Data.DataViewRowState state

The state.

Returns
Type Description
DataResult

SaveTableSimple(MetaDataContext, DataCommand, DataTable, DataViewRowState)

Saves the table simple.

Declaration
[Obsolete("This method is intended for internal use only. Use SaveTableSimple(DataCommand, DataTable). Will remain at least until November 2016.")]
public static DataResult SaveTableSimple(MetaDataContext context, DataCommand cmd, DataTable table, DataViewRowState state)
Parameters
Type Name Description
MetaDataContext context

The context.

DataCommand cmd

The CMD.

System.Data.DataTable table

The table.

System.Data.DataViewRowState state

The state.

Returns
Type Description
DataResult