DhRemoteDataSource Class

DhRemoteDataSource Class

This Package | All Packages

DhObjectFactory
  |
  +--DhObjectDataSource
    |
    +--DhRemoteDataSource
public class DhRemoteDataSource
extends DhObjectDataSource

Encapsulates the Microsoft Remote Data Service (formerly ADC) control, which allows access to database information across an HTTP connection.

Constructors
Name Description
DhRemoteDataSource() Creates a DhRemoteDataSource object.
DhRemoteDataSource( String strConnection, String strServer, String strSQL ) Creates a DhRemoteDataSource object.

Methods
Name Description
cancel() Cancels the current data-retrieval operation.
getConnectionString( ) Retrieves the current connection string (for example, "DSN=AdvWorks;") for this data source object.
getServer( ) Retrieves the currently set server name for this data source object.
getSortDirection( ) Retrieves the current sort direction.
getSortField( ) Retrieves the name of the currently sorted column.
getSQL() Retrieves the currently set SQL query string.
refresh() Refreshes the data source with new settings, such as a connection string or a SQL query.
setConnectionString( String strConn ) Sets the connection string (for example, "DSN=AdvWorks;") for this data source object.
setServer( String strServer ) Sets the HTTP server to query for database information.
setSortDirection( boolean fAscending ) Sets the sort direction.
setSortField( String strSortField ) Sets the field for sorting data.
setSQL( String strSQL ) Sets the SQL query for this object and refreshes, if necessary.
submitChanges() Gathers and submits any data changes made to bound controls.

Constructors

DhRemoteDataSource.DhRemoteDataSource

Syntax 1
public DhRemoteDataSource();
Description

Creates a DhRemoteDataSource object.



Syntax 2
public DhRemoteDataSource( String strConnection, String strServer, String strSQL );
Parameters
strConnection
The connection string (for example, "DSN=AdvWorks" ).
strServer
The server running the database (for example, http://dbserver).
strSQL
The SQL query to generate results (for example, "SELECT * FROM Products").
Description

Creates a DhRemoteDataSource object. This is a one-step construction with the connection string, server, and SQL query for the connection.

Methods

DhRemoteDataSource.cancel

Syntax
public void cancel();
Description

Cancels the current data-retrieval operation.

DhRemoteDataSource.getConnectionString

Syntax
public String getConnectionString( );
Return Value

Returns the current connection string.

Description

Retrieves the current connection string (for example, "DSN=AdvWorks;") for this data source object.

See Also
setConnectionString

DhRemoteDataSource.getServer

Syntax
public String getServer( );
Return Value

Returns the name of the current server.

Description

Retrieves the currently set server name for this data source object.

See Also
setServer

DhRemoteDataSource.getSortDirection

Syntax
public boolean getSortDirection( );
Return Value

Returns true if the sort direction is ascending, or returns false if it is descending.

Description

Retrieves the current sort direction.

See Also
setSortField

DhRemoteDataSource.getSortField

Syntax
public String getSortField( );
Return Value

Returns the currently sorted column name.

Description

Retrieves the name of the currently sorted column.

DhRemoteDataSource.getSQL

Syntax
public String getSQL();
Return Value

Returns the query String.

Description

Retrieves the currently set SQL query string.

DhRemoteDataSource.refresh

Syntax
public void refresh();
Description

Refreshes the data source with new settings, such as a connection string or a SQL query.

DhRemoteDataSource.setConnectionString

Syntax
public void setConnectionString( String strConn );
Parameters
strConn
The new connection string.
Description

Sets the connection string (for example, "DSN=AdvWorks;") for this data source object.

See Also
getConnectionString

DhRemoteDataSource.setServer

Syntax
public void setServer( String strServer );
Parameters
strServer
The server name (for example, "http://dbserver").
Description

Sets the HTTP server to query for database information.

DhRemoteDataSource.setSortDirection

Syntax
public void setSortDirection( boolean fAscending );
Parameters
fAscending
Set to true if the sort direction is ascending; set to false if it is descending.
Description

Sets the sort direction.

See Also
setSortField

DhRemoteDataSource.setSortField

Syntax
public void setSortField( String strSortField );
Parameters
strSortField
The name of the field to sort.
Description

Sets the field for sorting data.

DhRemoteDataSource.setSQL

Syntax
public void setSQL( String strSQL );
Parameters
strSQL
The desired SQL string.
Description

Sets the SQL query for this object and refreshes, if necessary.

DhRemoteDataSource.submitChanges

Syntax
public void submitChanges();
Description

Gathers and submits any data changes made to bound controls.