can't get two connecting strings from XML (web.config)
- by nCdy
XmlTextReader reader = new XmlTextReader(Window1.cfg.FSAddress);
bool[] startreading = {false , false};
while (reader.Read())
{
switch (reader.NodeType)
{
case XmlNodeType.Element: // ???? ???????? ?????????.
if (startreading[0])
{
if (reader.Name == "add")
if (startreading[1])
{
id2.Text = reader.GetAttribute(1);
return;
}
else
{
id1.Text = reader.GetAttribute(1);
startreading[1] = true;
startreading[0] = false;
}
}
else
if (reader.Name == "connectionStrings")
startreading[0] = true;
break;
case XmlNodeType.EndElement:
if (startreading[1])
if (reader.Name == "add")
startreading[0] = true;
break;
}
}
I take first one but ... then happens something strange and I'm missing second
sorry for my english . btw - Im getting it not from web project.