Return to Snippet

Revision: 9364
at November 2, 2008 02:08 by mn232nm


Initial Code
using System;
using System.Data.OleDb;
using System.Collections.Generic;
using System.Text;

namespace Web.DataAccess
{
    public sealed class AccessHelperUtility
    {
        private AccessHelperUtility() { }

        public static Dictionary<string, OleDbParameter> OleDbParameterArrayToGDictionary(params OleDbParameter[] paras)
        {
            if (null == paras) throw new ArgumentNullException("paras");
            Dictionary<string, OleDbParameter> retval = new Dictionary<string, OleDbParameter>();
            foreach (OleDbParameter p in paras) retval.Add(p.ParameterName, p);

            return retval;
        }

        public static List<OleDbParameter> OleDbParameterGDictionaryToGList(Dictionary<string, OleDbParameter> paras)
        {
            if (null == paras) throw new ArgumentNullException("paras");

            List<OleDbParameter> retval = new List<OleDbParameter>();
            foreach (string k in paras.Keys) retval.Add(paras[k]);
            return retval;
        }

        public static OleDbParameter[] OleDbParameterGDictionaryToArray(Dictionary<string, OleDbParameter> paras)
        {
            if (null == paras) throw new ArgumentNullException("paras");

            List<OleDbParameter> retval = new List<OleDbParameter>();
            foreach (string k in paras.Keys)
                retval.Add(paras[k]);
            return retval.ToArray();
        }
    }
}

Initial URL

                                

Initial Description
AccessHelperUtility.cs

Initial Title
AccessHelperUtility

Initial Tags
data

Initial Language
C#