public override DS_CurrencyRate.SP_GetCurrencyRateDataTable GetCurrencyRate(int currencyRateID)
 {
     using (var adapter = SP_GetCurrencyRateTableAdapter.CreateInstance(ConfigurationManagerEx.ConnectionString, ConfigurationManagerEx.CommandTimeout))
     {
         return(adapter.GetData(currencyRateID));
     }
 }
Exemple #2
0
        public static SP_GetCurrencyRateTableAdapter CreateInstance(string connectionString, int commandTimeout)
        {
            var adapter = new SP_GetCurrencyRateTableAdapter();

            if (string.IsNullOrEmpty(connectionString))
            {
                return(adapter);
            }
            foreach (var cmd in adapter.CommandCollection)
            {
                cmd.Connection.ConnectionString = connectionString;
                cmd.CommandTimeout = commandTimeout;
            }

            return(adapter);
        }