/// <summary> /// Fills a dataset and also returning the value of an output parameter. /// </summary> /// <param name="outputValue">A double to hold the value of the output parameter.</param> /// <returns>A dataset containing the result of the stored procedure.</returns> private static DataSet FillDataset(out double outputValue) { DataSet dataset = null; outputValue = default(double); var sql = "stp_GetMeTheDataAndSomeDoubleValue"; var outputParam = _DB.CreateOutputParameter(@"MyOutputParam", ADONETType.Double); try { dataset = _DB.FillDataSet(sql, CommandType.StoredProcedure, outputParam); outputValue = outputParam.GetValueOrDefault <double>(); } catch (Exception e) { // Exception handling code goes here... } return(dataset); }