private void HandleDataSourceAnnotation (XmlElement el, bool nested)
{
// Handle: Connections and Tables
// For Tables: extract the provider information from connection and use
// the corresponding providerfactory to create the adapter and et al objects
// and populate them
// #325464 debugging
//Console.WriteLine ("In HandleDataSourceAnnotation... ");
string providerName = null;
string connString = null;
DbProviderFactory provider = null;
XmlElement e, tablesElement = null, firstChild;
foreach (XmlNode n in el.ChildNodes) {
e = n as XmlElement;
if (e == null)
continue;
#if !MONOTOUCH
if (e.LocalName == "Connections" && (firstChild = e.FirstChild as XmlElement) != null) {
providerName = firstChild.GetAttribute ("Provider");
connString = firstChild.GetAttribute ("AppSettingsPropertyName");
provider = DbProviderFactories.GetFactory (providerName);
continue;
}
#endif // !MONOTOUCH
// #325464 debugging
//Console.WriteLine ("ProviderName: " + providerName + "Connstr: " + connString);
if (e.LocalName == "Tables")
tablesElement = e;
}
if (tablesElement != null && provider != null) {
foreach (XmlNode node in tablesElement.ChildNodes) {
ProcessTableAdapter (node as XmlElement, provider, connString);
}
}
}