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

About this Article
  • Created: 07/09/2017 5:09 am EDT
  • Last updated: 11/28/2017 8:51 am EST
In This Article