BVNetwork.NotFound.Core.Data.DataAccessBaseEx.ExecuteSQL C# (CSharp) Method

ExecuteSQL() public method

public ExecuteSQL ( string sqlCommand, List parameters ) : DataSet
sqlCommand string
parameters List
return System.Data.DataSet
        public DataSet ExecuteSQL(string sqlCommand, List<IDbDataParameter> parameters)
        {
            return base.Database.Execute<DataSet>(delegate
            {
                using (DataSet ds = new DataSet())
                {
                    try
                    {
                        DbCommand command = this.CreateCommand(sqlCommand);
                        if (parameters != null)
                        {
                            foreach (SqlParameter parameter in parameters)
                            {
                                command.Parameters.Add(parameter);
                            }
                        }
                        command.CommandType = CommandType.Text;
                        base.CreateDataAdapter(command).Fill(ds);
                    }
                    catch (Exception ex)
                    {
                        Logger.Error(string.Format("An error occureding in the ExecuteSQL method with the following sql{0}. Exception:{1}", sqlCommand, ex));
                    }

                    return ds;
                }
            });
        }