C# 클래스 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.

파일 보기 프로젝트 열기: argentini/Halide

공개 프로퍼티들

프로퍼티 타입 설명
Column DatabaseRow

공개 메소드들

메소드 설명
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.

메소드 상세

AddColumn() 공개 메소드

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.
리턴 System.Boolean

ColumnExists() 공개 메소드

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.
리턴 System.Boolean

DeleteColumn() 공개 메소드

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

DeleteColumn() 공개 메소드

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

EmailSanitize() 공개 메소드

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

EmailSanitize() 공개 메소드

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

Exec() 공개 메소드

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.
리턴 String

Exec() 공개 메소드

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.
리턴 String

Exec() 공개 메소드

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.
리턴 String

GetPrimarykeyName() 공개 메소드

Get the primary key column name.
public GetPrimarykeyName ( ) : String
리턴 String

H3DataRow() 공개 메소드

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.
리턴 System

H3DataRow() 공개 메소드

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.
리턴 System

H3DataRow() 공개 메소드

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.
리턴 System

H3DataRow() 공개 메소드

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

H3DataRow() 공개 메소드

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.
리턴 System

H3DataRow() 공개 메소드

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.
리턴 System

LoadForm() 공개 메소드

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.
리턴 System.Boolean

LoadForm() 공개 메소드

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.
리턴 System.Boolean

MarkupSanitize() 공개 메소드

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

MarkupSanitize() 공개 메소드

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

Sanitize() 공개 메소드

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.
리턴 void

ScriptSanitize() 공개 메소드

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

ScriptSanitize() 공개 메소드

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

SqlSanitize() 공개 메소드

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

SqlSanitize() 공개 메소드

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

this() 공개 메소드

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.
리턴 DatabaseItem

this() 공개 메소드

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.
리턴 DatabaseItem

프로퍼티 상세

Column 공개적으로 프로퍼티

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
리턴 DatabaseRow