Class QuerySelect
Object to do simple select querys on the CRM database. GetQuery()
public class QuerySelect : IDisposable
- Inheritance
-
QuerySelect
- Implements
- Inherited Members
Constructors
QuerySelect()
Initializes a new instance of QuerySelect.
public QuerySelect()
Properties
SQLCommand
Gets or sets the SQL statement to execute.
public string SQLCommand { get; set; }
Property Value
Methods
Dispose()
public void Dispose()
Eof()
Checks whether the query is at EOF.
public bool Eof()
Returns
- bool
true/false
ExecuteNonQuery()
Call ExecuteNonQuery to execute the SQL statement currently assigned to the SQLCommand property. Use to execute queries that do not return a set of records (such as INSERT, UPDATE, DELETE, and CREATE TABLE).
public int ExecuteNonQuery()
Returns
- int
Number of rows affected by the executed command.
ExecuteReader()
Call ExecuteReader to execute the SQL statement currently assigned to the SQLCommand property. Use to execute queries that return a set of records (such as SELECT).
public void ExecuteReader()
FieldValue(string)
Retrieves the value from any field in the query.
public string FieldValue(string fieldName)
Parameters
fieldName
stringAny fieldname previously selected in the query.
Returns
- string
The field value.
FieldValueAsDate(string)
Returns the Field value as DateTime.
public DateTime FieldValueAsDate(string fieldName)
Parameters
fieldName
stringField Name.
Returns
- DateTime
DateTime.
~QuerySelect()
Destructor for QuerySelect.
protected ~QuerySelect()
Next()
Moves onto the next row in the select.
public void Next()
SelectSql(string)
Executes a SQL command on the CRM database.
[Obsolete("Use the property SQLCommand and the method ExecuteReader")]
public void SelectSql(string sql)
Parameters
sql
stringSQL Query.