DataConnector
ADO.NET provider for Salesforce / Schema Details
In This Topic
    Schema Details
    In This Topic

    The ADO.NET provider for Salesforce supports schema discovery using ADO.NET classes or SQL statements to the system tables. The ADO.NET classes enable access to schema information of database, connection property and columns returned.

    GetSchema method of C1SalesforceConnection class is used to retrieve schema of the Database and DataTables. 

    In the below code example GetSchema method is called which returns Tables in the Database. In the second call, the method returns the columns in a specific data table.

    C#
    Copy Code
    static void Main(string[] args)
    {
        LoadSchemaTable("Order");
    }
    
    static void LoadSchemaTable(string tableName)
    { 
        Console.WriteLine($"LoadSchemaTable '{tableName}' started !!!");
        using (C1SalesforceConnection conn = new C1SalesforceConnection(GCSalesforceServerConnectionString))
        {
            conn.Open();
            //Get list of columns
            var table = conn.GetSchema("columns", new string[] { tableName });
            PrintData(table);
        }
    }