Click here to Skip to main content
15,914,642 members
Home / Discussions / C#
   

C#

 
AnswerRe: About attachments ?????!!!!!! Pin
J4amieC6-Feb-06 23:54
J4amieC6-Feb-06 23:54 
Questionmoving an object in a panel Pin
hpetriffer6-Feb-06 20:23
hpetriffer6-Feb-06 20:23 
QuestionDeployment Pin
JacquesDP6-Feb-06 19:46
JacquesDP6-Feb-06 19:46 
AnswerRe: Deployment Pin
mav.northwind6-Feb-06 21:29
mav.northwind6-Feb-06 21:29 
QuestionRe: Deployment Pin
JacquesDP6-Feb-06 22:04
JacquesDP6-Feb-06 22:04 
AnswerRe: Deployment Pin
mav.northwind7-Feb-06 0:02
mav.northwind7-Feb-06 0:02 
GeneralRe: Deployment Pin
JacquesDP7-Feb-06 0:38
JacquesDP7-Feb-06 0:38 
QuestionRe: Deployment Pin
JacquesDP6-Feb-06 22:58
JacquesDP6-Feb-06 22:58 
I'm having problems with the following code snippet. It executes the first Messagebox within the foreach, but then fails at the if just beneath that.
Can anyone help please.

foreach(XmlNode node in settingNode.ChildNodes)
{
System.Windows.Forms.MessageBox.Show("Inside foreach","Entered");

if(node.Attributes["key"].Value != null)
{
System.Windows.Forms.MessageBox.Show(node.Attributes["key"].Value,"Value");
if(node.Attributes["key"].Value == "ServerName")
{
System.Windows.Forms.MessageBox.Show("Saving Servername","Servername");
NumNode = node;
XmlAttribute att = NumNode.Attributes["value"];
att.Value = ServerName;
doc.Save(appConfigPath);
System.Windows.Forms.MessageBox.Show("Finished ServerName","Servername");
}
if(node.Attributes["key"].Value == "DBName")
{
System.Windows.Forms.MessageBox.Show("Saving dbName","dbname");
NumNode = node;
XmlAttribute att = NumNode.Attributes["value"];
att.Value = DBName;
doc.Save(appConfigPath);
System.Windows.Forms.MessageBox.Show("Finished dbname","dbname");
}
if(node.Attributes["key"].Value == "UserID")
{
System.Windows.Forms.MessageBox.Show("Saving UserId","UserId");
NumNode = node;
XmlAttribute att = NumNode.Attributes["value"];
att.Value = UserID;
doc.Save(appConfigPath);
System.Windows.Forms.MessageBox.Show("Finished UserId","UserId");
}
if(node.Attributes["key"].Value == "Password")
{
System.Windows.Forms.MessageBox.Show("Saving password","password");
NumNode = node;
XmlAttribute att = NumNode.Attributes["value"];
att.Value = Password;
doc.Save(appConfigPath);
System.Windows.Forms.MessageBox.Show("Finished password","password");
}
}
}
QuestionCOM+ and .NET Pin
paully6-Feb-06 18:51
paully6-Feb-06 18:51 
AnswerRe: COM+ and .NET Pin
leppie6-Feb-06 22:24
leppie6-Feb-06 22:24 
Questiongenerate the C# application by coding C# Pin
tadung6-Feb-06 17:31
tadung6-Feb-06 17:31 
AnswerRe: generate the C# application by coding C# Pin
jdkulkarni7-Feb-06 1:57
jdkulkarni7-Feb-06 1:57 
QuestionTransaction Number Pin
knight_sky6-Feb-06 16:04
knight_sky6-Feb-06 16:04 
AnswerRe: Transaction Number Pin
Judah Gabriel Himango6-Feb-06 16:10
sponsorJudah Gabriel Himango6-Feb-06 16:10 
AnswerRe: Transaction Number Pin
JacquesDP6-Feb-06 20:15
JacquesDP6-Feb-06 20:15 
Questionlocation of current document Pin
edel_ong6-Feb-06 15:06
edel_ong6-Feb-06 15:06 
AnswerRe: location of current document Pin
Judah Gabriel Himango6-Feb-06 16:13
sponsorJudah Gabriel Himango6-Feb-06 16:13 
GeneralRe: location of current document Pin
edel_ong6-Feb-06 16:34
edel_ong6-Feb-06 16:34 
GeneralRe: location of current document Pin
Judah Gabriel Himango6-Feb-06 16:37
sponsorJudah Gabriel Himango6-Feb-06 16:37 
GeneralRe: location of current document Pin
edel_ong6-Feb-06 17:09
edel_ong6-Feb-06 17:09 
GeneralRe: location of current document Pin
Judah Gabriel Himango6-Feb-06 17:18
sponsorJudah Gabriel Himango6-Feb-06 17:18 
GeneralRe: location of current document Pin
edel_ong6-Feb-06 17:24
edel_ong6-Feb-06 17:24 
GeneralRe: location of current document Pin
Judah Gabriel Himango6-Feb-06 17:26
sponsorJudah Gabriel Himango6-Feb-06 17:26 
QuestionOfficial Receipt Pin
knight_sky6-Feb-06 14:32
knight_sky6-Feb-06 14:32 
AnswerRe: Official Receipt Pin
KevinMac6-Feb-06 18:32
KevinMac6-Feb-06 18:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.