Genpact Cora Knowledge Center

Support

Get the Connection String Using the API

Add reference to Pnmsoft.Sequence, Pnmsoft.Sequence.Data, and Pnmsoft.Sequence.Security.

using System.Data;
using PNMsoft.Sequence.Configuration;
using PNMsoft.Sequence.Utility;
using System.Data.Common;


DatabaseConfigurationElement database = ConfigUtil.GetDatabase();
DataProvider provider = DataProviderFactory.Create(database.Provider, database.ConnectionString);
using (IDataReader reader = DataProviderExtensions.ExecuteReader(provider, "Some SP", new DbParameter[] { DataProviderExtensions.CreateInParameter(provider, "param1", DbType.String, "param1 value") }))
            {
                //Do something
            }
        }