void CheckParam (string pName, string p, int length)
{
if (p == null)
throw new ArgumentNullException (pName);
if (p.Length == 0 || p.Length > length || p.IndexOf (',') != -1)
throw new ArgumentException (String.Format ("invalid format for {0}", pName));
}