Show / Hide Table of Contents

    DbResultSet.GetPbDataType(int columnIndex) Method

    .NET Standard 2.x

    Gets the data type in PowerBuilder for the specified column in the result set.

    Namespace: PowerScript.Bridge

    Assembly: PowerScript.Bridge.dll

    Syntax

      public PbDataType GetPbDataType(int columnIndex)
    

    Parameters

    columnIndex System.Int32

    The index number of the column.

    Returns

    PowerScript.Bridge.PbDataType

    Returns the data type in PowerBuilder.

    Examples

    The following code example demonstrates how to use the GetPbDataType method to get the PowerBuilder data type of the second column in the DbResultSet object.

    using System;
    using SnapObjects.Data;
    using PowerScript.Bridge;
    
    namespace Appeon.ApiDoc.DbResultSetExamples
    {
        public class GetPbDataTypeExample
        {
            private readonly SchoolContext _context;
    
            public GetPbDataTypeExample(SchoolContext dataContext)
            {
                // Sets the data context
                _context = dataContext;
            }
    
            public void Example1()
            {
                int studentID = 2;
    
                // Executes a stored procedure which gets the data of StudentGrade table according to StudentID.
                _context.SqlExecutor.ExecuteProcedure("GetStudentGrades",
                    out DbResultSet resultSet, ParamValue.New<int>("StudentID", studentID));
    
                resultSet.Next();
    
                if (resultSet.SqlCode == 0)
                {
                    // Gets the PowerBuilder data type of the second column
                    var pbType = resultSet.GetPbDataType(1);
    
                    Console.WriteLine($"pbType = {pbType}");
                }
    
                resultSet.Close();
    
                /*This code produces the following output:
                
                pbType = Decimal
                */
            }
        }
    }
    

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon