Méthode | Description | |
---|---|---|
FindParameterPlaceholders ( IDbCommand command ) : int[] |
All SQL strings generated by FastDAO use ? as the parameter placeholder. For a database that needs another format, an AbstractSqlConnectionDescriptor subclass needs to swap the ?s out with something else. This helper
|
|
FindParameterPlaceholders ( string sql ) : int[] |
All SQL strings generated by FastDAO use ? as the parameter placeholder. For a database that needs another format, an AbstractSqlConnectionDescriptor subclass needs to swap the ?s out with something else. This helper
|
|
MakeDeleteStatement ( string table, object>.IDictionary |
Generates a delete statement to delete rows where "key" = whereCols["key"] for everything in whereCols.
|
|
MakeInsertStatement ( string table, object>.IDictionary |
Generates an insert statement to insert the values from the dictionary into the specified table. Uses parameters for the values, the values will be taken from the dictionary and inserted into sqlParams in the same order the column names are inserted in the sql string.
|
|
MakeInsertStatement ( string table, object>.IDictionary |
Generates an insert statement to insert the values from the dictionary into the specified table. Uses parameters for the values, the values will be taken from the dictionary and inserted into sqlParams in the same order the column names are inserted in the sql string.
|
|
MakeUpdateStatement ( string table, object>.IDictionary |
Generates an update statement to update rows where "key" = whereCols["key"] for everything in whereCols.
|
|
MakeWhereClause ( object>.IDictionary |
Helper method to generate a where clause, where keys = values. You can simply concatenate this on the end of an SQL statement ("SELECT something " + MakeWhereClause(...)).
|
|
SqlParamsToString ( string sql, IEnumerable sqlParams ) : string |
Converts the sql statement and parameters into a nicely formatted string for output in error messages or log statements.
|
public static FindParameterPlaceholders ( IDbCommand command ) : int[] | ||
command | IDbCommand | The command whose text should be searched for ? characters. |
Résultat | int[] |
public static FindParameterPlaceholders ( string sql ) : int[] | ||
sql | string | The SQL string with embedded ? placeholders. |
Résultat | int[] |
public static MakeDeleteStatement ( string table, object>.IDictionary |
||
table | string | Name of the table to be inserted into. |
whereCols | object>.IDictionary | Dictionary of object column values keyed by string column names. /// These columns are used in the "where" clause of the statement. If /// this collection is null or empty, all rows will be updated. |
sqlParams | IList | List to insert sql param values (in order) into. |
Résultat | string |
public static MakeInsertStatement ( string table, object>.IDictionary |
||
table | string | Name of the table to be inserted into. |
columns | object>.IDictionary | Dictionary of object column values keyed by string column names. |
sqlParams | IList | List to insert sql param values (in order) into. |
Résultat | string |
public static MakeInsertStatement ( string table, object>.IDictionary |
||
table | string | Name of the table to be inserted into. |
columns | object>.IDictionary | Dictionary of object column values keyed by string column names. |
sqlParams | IList | List to insert sql param values (in order) into. |
valueStrings | string>.IDictionary | Optional dictionary of parameter placeholders to use instead of ?. |
Résultat | string |
public static MakeUpdateStatement ( string table, object>.IDictionary |
||
table | string | Name of the table to be inserted into. |
whereCols | object>.IDictionary | Dictionary of object column values keyed by string column names. /// These columns are used in the "where" clause of the statement. If /// this collection is null or empty, all rows will be updated. |
columns | object>.IDictionary | Dictionary of object column values keyed by string column names. These /// columns are the values that will be set on the row(s). This collection /// may not be null or empty. |
sqlParams | IList | List to insert sql param values (in order) into. |
Résultat | string |
public static MakeWhereClause ( object>.IDictionary |
||
whereCols | object>.IDictionary | Dictionary of object column values keyed by string column names. |
sqlParams | IList | List to insert sql param values (in order) into. |
Résultat | string |
public static SqlParamsToString ( string sql, IEnumerable sqlParams ) : string | ||
sql | string | The SQL statement that needs the list of params. |
sqlParams | IEnumerable | The list of params to format. |
Résultat | string |