Databases Reference
In-Depth Information
C#
public IDbCommand CreateCommand()
{ // Return a new instance of the implementation-specific command object
return new DataSetCommand(this);
}
VB.NET
Public Function CreateCommand() As IDbCommand _
Implements IDbConnection.CreateCommand
'Return a new instance of the implementation specific command object
Return New DataSetCommand(Me)
End Function
Open Method
In a full data provider implementation, the Open method is used to make a data source-specific connec-
tion. Your implementation will use the Open method to create an instance of a generic data set object
from the Framework Class Libraries and fill it from the filename provided in our ConnectionString
property.
C#
public void Open ()
{
this.dataSet = new FCLData.DataSet ();
this.dataSet.ReadXml (this.m_fileName);
}
VB.NET
Public Sub Open() Implements IDbConnection.Open
Me.dataSet = New FCLData.DataSet
Me.dataSet.ReadXml(Me.m_fileName)
End Sub
Close Method
The Close method is used to close your data source-specific connection. You are going to use the Close
method to release the DataSet object that you have in memory.
C#
public void Close ()
{
this.dataSet=null;
}
VB.NET
Public Sub Close() Implements IDbConnection.Close
set the connection state to close and return
Me.dataSet = Nothing
End Sub
Search WWH ::




Custom Search