The DataServer type exposes the following members.

Constructors

  NameDescription
Public methodDataServer(String)
Instantiate a new DataServer using the supplied connection string
Public methodDataServer(IiMISUser)
Instantiate a new DataServer using the connection string associated with the IiMISUser object sent in as a parameter.

Methods

  NameDescription
Public methodBeginTransaction
Starts a database transaction. Any other database operations performed using this instance of the DataServer will be in the same transaction until a CommitTransaction()()()() or RollbackTransaction()()()() is called.
Public methodStatic memberBindAndExecute
Binds the supplied parameters to the supplied command and executes the command. The command must have been prepared with a call to PrepareCommand(SqlCommand, CommandType, String, array<SqlParameter>[]()[][]). This method can then be called in a loop with different parameters to save the prepare time when the same statement is executed over and over.
Public methodCloseConnection
Closes the connection to the database if it is open. If there is no open Connection no harm is done by calling this method. If there is an open connection and there is also an open transaction the transaction will be rolled back before the connection is closed.
Public methodCommitTransaction
If there is an open transaction associated with this DataServer instance, it will be committed. If there is no open transaction no harm is done by calling this method.
Public methodCreateObjRef
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
(Inherited from MarshalByRefObject.)
Public methodDispose
Rolls back and open transaction and closes any open connection
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodExecuteNonQuery(CommandType, String)
Executes the SQL query in the sql parameter against the database. Use this method when the sql query does not return a result set (e.g., INSERT, UPDATE, or some stored procs). Otherwise, use ExecuteQuery(CommandType, String) if a result set is desired.
Public methodExecuteNonQuery(CommandType, String, array<SqlParameter>[]()[][])
Executes the SQL query in the sql parameter against the database. Use this method when the sql query does not return a result set (e.g., INSERT, UPDATE, or some stored procs). Otherwise, use ExecuteQuery(CommandType, String, array<SqlParameter>[]()[][]) if a result set is desired.
Public methodExecuteQuery(CommandType, String)
Executes the SQL query in the sql parameter against the database. Use this method when the sql query returns a result set (e.g., SELECT or some stored procs). Otherwise, use ExecuteNonQuery(CommandType, String).
Public methodExecuteQuery(CommandType, String, array<SqlParameter>[]()[][])
Executes the SQL query in the sql parameter against the database. Use this method when the sql query returns a result set (e.g., SELECT or some stored procs). Otherwise, use ExecuteNonQuery(CommandType, String, array<SqlParameter>[]()[][]).
Public methodExecuteReader(CommandType, String)
Executes the SQL query in the sql parameter against the database. Use this method when the sql query returns a result set (e.g., SELECT or some stored procs). Otherwise, use ExecuteNonQuery(CommandType, String).
Public methodExecuteReader(CommandType, String, array<SqlParameter>[]()[][])
Executes the SQL query in the sql parameter against the database. Use this method when the sql query returns a result set (e.g., SELECT or some stored procs). Otherwise, use ExecuteNonQuery(CommandType, String, array<SqlParameter>[]()[][]).
Public methodExecuteScalar
Executes the query, and returns the first column of the first row in the resultset returned by the query. Extra columns or rows are ignored.
Protected methodFinalize
Destructor
(Overrides Object..::..Finalize()()()().)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetLifetimeService
Retrieves the current lifetime service object that controls the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInitializeLifetimeService
Obtains a lifetime service object to control the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Protected methodMemberwiseClone()()()()
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodMemberwiseClone(Boolean)
Creates a shallow copy of the current MarshalByRefObject object.
(Inherited from MarshalByRefObject.)
Public methodPrepareCommand
Prepares a SQL command to be executed. This should not normally be called outside of this class but is public in case the same statement needs to be executed over and over with different bind variables.
Public methodRollbackTransaction
If there is an open transaction associated with this DataServer instance, all statements executed within that transaction will be rolled back (discarded). If there is no open transaction no harm is done by calling this method.
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)

Properties

  NameDescription
Public propertyConnection
Gets the current SqlConnection to the database.
Public propertyIsTransactionOpen
Gets an indication of whether or not the DataServer instance has an open transaction

See Also