C# Class Argentini.Halide.H3DataRow

The Halide H3DataRow class is used to load and manipulate an entire row from a database table/view/SP, and uses Halide.DatabaseRow and Halide.DatabaseItem classes as children.

Note that H3DataRow is case-sensitive! So when you use methods like "Exec" which send H3DataRow column values back to a stored procedure, the column names must match the stored procedure names, including case, which also must match the destination table names, including case.

In addition, the "Exec" method will not work with stored procedures that use OUTPUT parameters.

Afficher le fichier Open project: argentini/Halide

Méthodes publiques

Свойство Type Description
Column DatabaseRow

Méthodes publiques

Méthode Description
AddColumn ( String columnName, String columnValue ) : System.Boolean

Add a column to the data set in memory. This is useful when stored procedures used for saving data require optional parameters.

ColumnExists ( String columnName ) : System.Boolean

Determine if a column of a specific name exists in the data set.

DeleteColumn ( String columnName ) : System.Boolean

Delete a column from the data set in memory.

DeleteColumn ( int index ) : System.Boolean

Delete a column from the data set in memory.

EmailSanitize ( String columnName ) : void

Strips specific field data of dangerous email header text.

EmailSanitize ( int columnIndex ) : void

Strips specific field data of dangerous email header text.

Exec ( String spName ) : String

Execute the specified stored procedure. Parameters used in the stored procedure must match column names in the currently loaded data row. If so, this method will automatically send the appropriate data to the procedure.

This method is useful for saving the record back to the database, marking a record for deletion, and more.

This method assumes that the stored procedure returns a value. If it does not, the procedure will execute, but an exception will be thrown.

Exec ( String spName, System.Boolean sendAll ) : String

Execute the specified stored procedure. Parameters used in the stored procedure must match column names in the currently loaded data row. If so, this method will automatically send the appropriate data to the procedure.

This method is useful for saving the record back to the database, marking a record for deletion, and more.

This method assumes that the stored procedure returns a value. If it does not, the procedure will execute, but an exception will be thrown.

Exec ( String spName, System.Boolean sendAll, System.Boolean returnsValue ) : String

Execute the specified stored procedure. Parameters used in the stored procedure must match column names in the currently loaded data row. If so, this method will automatically send the appropriate data to the procedure.

This method is useful for saving the record back to the database, marking a record for deletion, and more.

GetPrimarykeyName ( ) : String

Get the primary key column name.

H3DataRow ( Control containerControl ) : System

Instantiate the class with a Control object reference. This is used to read in a group of controls and their values from within the parent control. If using the "Exec()" method, this allows the developer to easily save a submitted form to a database without having to manually process and pass the stord procedure parameters. Uses the default connection string "Halide".

H3DataRow ( Control containerControl, String UseconnectionStringName ) : System

Instantiate the class with a Control object reference. This is used to read in a group of controls and their values from within the parent control. If using the "Exec()" method, this allows the developer to easily save a submitted form to a database without having to manually process and pass the stord procedure parameters.

H3DataRow ( H3DataRowConfig DataCon ) : System

Instantiate the class with a Halide.H3DataRowConfig class variable to specify what should be loaded, and from where. You must specify either 1) a SQL Command, or 2) a Table Name, Primary Key Name and Primary Key Value. SQL command overrides all other parameters.

H3DataRow ( Halide reader ) : System

Instantiate the class with an open H3Reader object.

H3DataRow ( String connectionStringName ) : System

Instantiate the class with a connection string name. This method is primarily for inserting new objects into a database.

H3DataRow ( String sqlCommand, String UseconnectionStringName ) : System

Instantiate the class with a complete SQL statement.

LoadForm ( Control p ) : System.Boolean

Load content from controls. This is done automatically when instantiating the class with a Control object, so use this method with care. Clears existing columns data before load.

LoadForm ( Control p, System.Boolean clearData ) : System.Boolean

Load content from controls. This is done automatically when instantiating the class with a Control object, so use this method with care.

MarkupSanitize ( String columnName ) : void

Strips specific field data of markup.

MarkupSanitize ( int columnIndex ) : void

Strips specific field data of markup.

Sanitize ( SanitizeOptions options ) : void

Sanitize all fields for a specified type of data.

ScriptSanitize ( String columnName ) : void

Strips specific field data of dangerous script markup.

ScriptSanitize ( int columnIndex ) : void

Strips specific field data of dangerous script markup.

SqlSanitize ( String columnName ) : void

Sanitizes specific field data for SQL use by doubling apostrophes.

SqlSanitize ( int columnIndex ) : void

Sanitizes specific field data for SQL use by doubling apostrophes.

this ( String columnName ) : DatabaseItem

Used to quickly retrieve a single column from the database row that has been read.

this ( int x ) : DatabaseItem

Used to quickly retrieve a single column from the database row that has been read.

Method Details

AddColumn() public méthode

Add a column to the data set in memory. This is useful when stored procedures used for saving data require optional parameters.
public AddColumn ( String columnName, String columnValue ) : System.Boolean
columnName String Name of the new column.
columnValue String Value of the new column.
Résultat System.Boolean

ColumnExists() public méthode

Determine if a column of a specific name exists in the data set.
public ColumnExists ( String columnName ) : System.Boolean
columnName String Name of the database column.
Résultat System.Boolean

DeleteColumn() public méthode

Delete a column from the data set in memory.
public DeleteColumn ( String columnName ) : System.Boolean
columnName String Name of the column to delete.
Résultat System.Boolean

DeleteColumn() public méthode

Delete a column from the data set in memory.
public DeleteColumn ( int index ) : System.Boolean
index int Index number of the column to delete.
Résultat System.Boolean

EmailSanitize() public méthode

Strips specific field data of dangerous email header text.
public EmailSanitize ( String columnName ) : void
columnName String Name of the data column to process.
Résultat void

EmailSanitize() public méthode

Strips specific field data of dangerous email header text.
public EmailSanitize ( int columnIndex ) : void
columnIndex int Index of the data column to process.
Résultat void

Exec() public méthode

Execute the specified stored procedure. Parameters used in the stored procedure must match column names in the currently loaded data row. If so, this method will automatically send the appropriate data to the procedure.

This method is useful for saving the record back to the database, marking a record for deletion, and more.

This method assumes that the stored procedure returns a value. If it does not, the procedure will execute, but an exception will be thrown.

public Exec ( String spName ) : String
spName String Name of the stored procedure.
Résultat String

Exec() public méthode

Execute the specified stored procedure. Parameters used in the stored procedure must match column names in the currently loaded data row. If so, this method will automatically send the appropriate data to the procedure.

This method is useful for saving the record back to the database, marking a record for deletion, and more.

This method assumes that the stored procedure returns a value. If it does not, the procedure will execute, but an exception will be thrown.

public Exec ( String spName, System.Boolean sendAll ) : String
spName String Name of the stored procedure.
sendAll System.Boolean Send all columns to the stored procedure as parameters, /// instead of auto-detecting which parameters the procedure wants. This is /// useful when you construct the class using a reader that has disabled the /// feature whereby it loads the schema.
Résultat String

Exec() public méthode

Execute the specified stored procedure. Parameters used in the stored procedure must match column names in the currently loaded data row. If so, this method will automatically send the appropriate data to the procedure.

This method is useful for saving the record back to the database, marking a record for deletion, and more.

public Exec ( String spName, System.Boolean sendAll, System.Boolean returnsValue ) : String
spName String Name of the stored procedure.
sendAll System.Boolean Send all columns to the stored procedure as parameters, /// instead of auto-detecting which parameters the procedure wants. This is /// useful when you construct the class using a reader that has disabled the /// feature whereby it loads the schema.
returnsValue System.Boolean If the stored procedure returns a value, set to true, /// otherwise, set to false. When false, the number of rows affected is returned as a string.
Résultat String

GetPrimarykeyName() public méthode

Get the primary key column name.
public GetPrimarykeyName ( ) : String
Résultat String

H3DataRow() public méthode

Instantiate the class with a Control object reference. This is used to read in a group of controls and their values from within the parent control. If using the "Exec()" method, this allows the developer to easily save a submitted form to a database without having to manually process and pass the stord procedure parameters. Uses the default connection string "Halide".
public H3DataRow ( Control containerControl ) : System
containerControl System.Web.UI.Control Control object with submitted form data.
Résultat System

H3DataRow() public méthode

Instantiate the class with a Control object reference. This is used to read in a group of controls and their values from within the parent control. If using the "Exec()" method, this allows the developer to easily save a submitted form to a database without having to manually process and pass the stord procedure parameters.
public H3DataRow ( Control containerControl, String UseconnectionStringName ) : System
containerControl System.Web.UI.Control Control object with submitted form data.
UseconnectionStringName String Name of a connection string within the Web.config file.
Résultat System

H3DataRow() public méthode

Instantiate the class with a Halide.H3DataRowConfig class variable to specify what should be loaded, and from where. You must specify either 1) a SQL Command, or 2) a Table Name, Primary Key Name and Primary Key Value. SQL command overrides all other parameters.
public H3DataRow ( H3DataRowConfig DataCon ) : System
DataCon H3DataRowConfig Halide.H3DataRowConfig object with database settings.
Résultat System

H3DataRow() public méthode

Instantiate the class with an open H3Reader object.
public H3DataRow ( Halide reader ) : System
reader Halide Halide.H3Reader object, opened and read().
Résultat System

H3DataRow() public méthode

Instantiate the class with a connection string name. This method is primarily for inserting new objects into a database.
public H3DataRow ( String connectionStringName ) : System
connectionStringName String A connection string name.
Résultat System

H3DataRow() public méthode

Instantiate the class with a complete SQL statement.
public H3DataRow ( String sqlCommand, String UseconnectionStringName ) : System
sqlCommand String Complete SQL command string to use for reading the desired row.
UseconnectionStringName String Name of a connection string within the Web.config file.
Résultat System

LoadForm() public méthode

Load content from controls. This is done automatically when instantiating the class with a Control object, so use this method with care. Clears existing columns data before load.
public LoadForm ( Control p ) : System.Boolean
p System.Web.UI.Control Page object.
Résultat System.Boolean

LoadForm() public méthode

Load content from controls. This is done automatically when instantiating the class with a Control object, so use this method with care.
public LoadForm ( Control p, System.Boolean clearData ) : System.Boolean
p System.Web.UI.Control Page object.
clearData System.Boolean Clear existing column data or not.
Résultat System.Boolean

MarkupSanitize() public méthode

Strips specific field data of markup.
public MarkupSanitize ( String columnName ) : void
columnName String Name of the data column to process.
Résultat void

MarkupSanitize() public méthode

Strips specific field data of markup.
public MarkupSanitize ( int columnIndex ) : void
columnIndex int Index of the data column to process.
Résultat void

Sanitize() public méthode

Sanitize all fields for a specified type of data.
public Sanitize ( SanitizeOptions options ) : void
options SanitizeOptions SanitizeOptions enum value specifying which type of filtering to run.
Résultat void

ScriptSanitize() public méthode

Strips specific field data of dangerous script markup.
public ScriptSanitize ( String columnName ) : void
columnName String Name of the data column to process.
Résultat void

ScriptSanitize() public méthode

Strips specific field data of dangerous script markup.
public ScriptSanitize ( int columnIndex ) : void
columnIndex int Index of the data column to process.
Résultat void

SqlSanitize() public méthode

Sanitizes specific field data for SQL use by doubling apostrophes.
public SqlSanitize ( String columnName ) : void
columnName String Name of the data column to process.
Résultat void

SqlSanitize() public méthode

Sanitizes specific field data for SQL use by doubling apostrophes.
public SqlSanitize ( int columnIndex ) : void
columnIndex int Index of the data column to process.
Résultat void

this() public méthode

Used to quickly retrieve a single column from the database row that has been read.
public this ( String columnName ) : DatabaseItem
columnName String Name of the column to return.
Résultat DatabaseItem

this() public méthode

Used to quickly retrieve a single column from the database row that has been read.
public this ( int x ) : DatabaseItem
x int Index number of the column to return.
Résultat DatabaseItem

Property Details

Column public_oe property

Access an individual data column using this object (see the DatabaseItem object for methods and properties). The preferred way to access this object is using a H3DataRow object indexer.
public DatabaseRow,Argentini.Halide Column
Résultat DatabaseRow