dotConnect for Salesforce Documentation
Devart.Data Namespace / SqlShimConnection Class
Members Example

In This Topic
    SqlShimConnection Class
    In This Topic
    Represents an open connection to a cloud application.
    Syntax
    'Declaration
     
    Public MustInherit Class SqlShimConnection 
       Inherits Devart.Common.DbConnectionBase
       Implements System.ComponentModel.IComponentSystem.Data.IDbConnectionSystem.IDisposable 
    Remarks
    The abstract SqlShimConnection class implements the common cloud connection functionality.
    Example
    The following sample demonstrates how using base classes helps to create data source-independent code.
    public void PrintData(SqlShimConnection myConnection) {
    	SqlShimCommand myCommand = (SqlShimCommand)myConnection.CreateCommand();
    	myCommand.CommandText = "SELECT Id, Name, Type FROM Account";
    	myConnection.Open();
    	SqlShimDataReader myReader = myCommand.ExecuteReader();
    	try {
    		while (myReader.Read()) {
    			Console.WriteLine(myReader.GetString(0) + " " + 
    				myReader.GetString(1) + " " + myReader.GetString(2));
    		}
    	}
    	finally {
    		myReader.Close();
    		myConnection.Close();
    	}
    }
    Public Sub PrintData(ByVal myConnection As SqlShimConnection)
    	Dim myCommand As SqlShimCommand = myConnection.CreateCommand()
    	myCommand.CommandText = "SELECT Id, Name, Type FROM Account"
    	myConnection.Open()
    	Dim myReader As SqlShimDataReader = myCommand.ExecuteReader()
    	Try
    		While myReader.Read()
    			Console.WriteLine(String.Concat(myReader.GetString(0), " ", _
    				myReader.GetString(1), " ", myReader.GetString(2)))
    		End While
    	Finally
    		myReader.Close()
    		myConnection.Close()
    	End Try
    End Sub
    Inheritance Hierarchy

    System.Object
       System.MarshalByRefObject
          System.ComponentModel.Component
             System.Data.Common.DbConnection
                Devart.Common.DbConnectionBase
                   Devart.Data.SqlShimConnection
                      Devart.Data.Salesforce.SalesforceConnection

    See Also