ADO.NET Provider for Microsoft Dynamics CRM

Build 24.0.9060

Procedures

The Procedures schema collection describes the available stored procedures.

Retrieving the Stored Procedure Listing

To retrieve the Procedures schema collection, call the GetSchema method of the DynamicsCRMConnection class. Access the metadata in the DataTable object returned.

The following example outputs a list of stored procedure names:

C#

String connectionString = "User=myuseraccount;Password=mypassword;URL=https://myOrg.crm.dynamics.com/;CRM Version=CRM Online;";

using (DynamicsCRMConnection conn = new DynamicsCRMConnection(connectionString)) {
  conn.Open();
  DataTable table = conn.GetSchema("Procedures");
  foreach (DataRow row in table.Rows)
   Console.WriteLine(row["SPECIFIC_NAME"]);
}

VB.NET

Dim connectionString As String = "User=myuseraccount;Password=mypassword;URL=https://myOrg.crm.dynamics.com/;CRM Version=CRM Online;"

Using conn As New DynamicsCRMConnection(connectionString)
  conn.Open()
  Dim table As DataTable = conn.GetSchema("Procedures")
  For Each row As DataRow in table.Rows
    Console.WriteLine(row("SPECIFIC_NAME"))
  Next
End Using

Columns Returned

The Procedures schema collection contains the following columns:

Column NameData TypeDescription
SPECIFIC_CATALOGSystem.StringThe name of the database containing the stored procedure.
SPECIFIC_SCHEMASystem.StringThe schema that contains the stored procedure.
SPECIFIC_NAMESystem.StringThe name of the stored procedure containing the parameter.
ROUTINE_CATALOGSystem.StringThe database containing the stored procedure.
ROUTINE_SCHEMASystem.StringThe schema containing the stored procedure.
ROUTINE_NAMESystem.StringThe name of the stored procedure.
ROUTINE_TYPESystem.StringReturns PROCEDURE for stored procedures and FUNCTION for functions.

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 24.0.9060