private ArrayList ProcessDbParameters (XmlElement el)
{
//Console.WriteLine ("ProcessDbParameters: "+el.LocalName);
string tmp = null;
XmlElement e;
DbParameter param = null;
ArrayList parameters = new ArrayList ();
if (el == null)
return parameters;
foreach (XmlNode n in el.ChildNodes) {
e = n as XmlElement;
if (e == null)
continue;
param = currentAdapter.Provider.CreateParameter ();
tmp = e.GetAttribute ("AllowDbNull");
if (!String.IsNullOrEmpty (tmp))
param.IsNullable = Convert.ToBoolean (tmp);
param.ParameterName = e.GetAttribute ("ParameterName");
tmp = e.GetAttribute ("ProviderType");
if (!String.IsNullOrEmpty (tmp))
tmp = e.GetAttribute ("DbType");
param.FrameworkDbType = tmp;
tmp = e.GetAttribute ("Direction");
param.Direction = (ParameterDirection) Enum.Parse (typeof (ParameterDirection), tmp);
((IDbDataParameter)param).Precision = Convert.ToByte (e.GetAttribute ("Precision"));
((IDbDataParameter)param).Scale = Convert.ToByte (e.GetAttribute ("Scale"));
param.Size = Convert.ToInt32 (e.GetAttribute ("Size"));
param.SourceColumn = e.GetAttribute ("SourceColumn");
tmp = e.GetAttribute ("SourceColumnNullMapping");
if (!String.IsNullOrEmpty (tmp))
param.SourceColumnNullMapping = Convert.ToBoolean (tmp);
tmp = e.GetAttribute ("SourceVersion");
param.SourceVersion = (DataRowVersion) Enum.Parse (typeof (DataRowVersion), tmp);
parameters.Add (param);
}
return parameters;
}