Click here to Skip to main content
15,897,891 members
Home / Discussions / C#
   

C#

 
AnswerRe: Dataset for customizable project settings?? Pin
Henry Minute2-Apr-09 15:01
Henry Minute2-Apr-09 15:01 
GeneralRe: Dataset for customizable project settings?? Pin
agent00zelda6-Apr-09 1:45
agent00zelda6-Apr-09 1:45 
Question[Message Deleted] Pin
csipahi2-Apr-09 9:44
csipahi2-Apr-09 9:44 
AnswerRe: Back Buffer Putting pixel? Pin
Xmen Real 2-Apr-09 15:52
professional Xmen Real 2-Apr-09 15:52 
GeneralRe: Back Buffer Putting pixel? Pin
csipahi5-Apr-09 12:34
csipahi5-Apr-09 12:34 
Question[Message Deleted] Pin
hkjghkj12-Apr-09 9:40
hkjghkj12-Apr-09 9:40 
AnswerRe: Creating table in mdb from textbox Pin
Wes Aday2-Apr-09 12:41
professionalWes Aday2-Apr-09 12:41 
QuestionPLEASE HELP trying to get data from xml using c# Pin
faizych2-Apr-09 9:39
faizych2-Apr-09 9:39 
hi im doing a small project for friend.. i need to get the data out of xml so that i can verify the username and password
xml is like this

PLEASE HELP THE ERROR I GET IS EXPLAINED IN THE MIDDLE.. THANKS ALOTTTT

<clientlogind>
<client username="faizych">
Password="pass"
/>
<client username="taha89">
Password="pass78"
/>


and to get the value im doing

private void button1_Click(object sender, EventArgs e)
{
XmlDocument xmldoc = new XmlDocument();

xmldoc.Load("path.xml");

System.Xml.XmlNodeList client;
XmlNode clientNode = xmldoc.DocumentElement;

client = clientNode.SelectNodes("Client");

string Usernamttext = txtUsername.Text;
string passwordtext = txtpassword.Text;



foreach (XmlNode DataNode in client)
{

string userid;
string password;


************************************************************************************************
******* ERROR HERE*** now when i run it it gives me an error when it gets to the line below that """object reference not set to an instance of an object"""
*************************************************************************************************

userid = DataNode.SelectSingleNode("Username").InnerText.Trim();
password = DataNode.SelectSingleNode("password").InnerText.Trim();

if (string.Compare(Usernamttext, userid) == 0)
{
if (string.Compare(passwordtext, password) == 0)
{
break;
UserProfile UserProfileForm = new UserProfile();
UserProfileForm.usernamevalue = userid;
UserProfileForm.Show();
this.Close();

}
else
{
MessageBox.Show("Invalid Username or password");
}
}
}


}
AnswerRe: PLEASE HELP trying to get data from xml using c# Pin
EliottA2-Apr-09 9:51
EliottA2-Apr-09 9:51 
AnswerRe: PLEASE HELP trying to get data from xml using c# Pin
DaveyM692-Apr-09 10:38
professionalDaveyM692-Apr-09 10:38 
GeneralRe: PLEASE HELP trying to get data from xml using c# Pin
Henry Minute2-Apr-09 11:26
Henry Minute2-Apr-09 11:26 
AnswerRe: PLEASE HELP trying to get data from xml using c# Pin
Xmen Real 2-Apr-09 16:00
professional Xmen Real 2-Apr-09 16:00 
QuestionSingle Elimination - Tournament Brackets Pin
aslamc2-Apr-09 9:29
aslamc2-Apr-09 9:29 
AnswerRe: Single Elimination - Tournament Brackets Pin
aslamc3-Apr-09 12:40
aslamc3-Apr-09 12:40 
GeneralRe: Single Elimination - Tournament Brackets Pin
Ed K13-Nov-12 12:38
Ed K13-Nov-12 12:38 
QuestionApplying Separator in Combo Box....help plz! [modified] Pin
Rajdeep.NET is BACK2-Apr-09 9:10
Rajdeep.NET is BACK2-Apr-09 9:10 
AnswerRe: Applying Separator in Combo Box....help plz! Pin
DaveyM692-Apr-09 10:09
professionalDaveyM692-Apr-09 10:09 
GeneralRe: Applying Separator in Combo Box....help plz! Pin
Rajdeep.NET is BACK2-Apr-09 10:49
Rajdeep.NET is BACK2-Apr-09 10:49 
QuestionDrawLine on Panel? Not saving? Pin
Jacob Dixon2-Apr-09 9:03
Jacob Dixon2-Apr-09 9:03 
AnswerRe: DrawLine on Panel? Not saving? Pin
Colin Angus Mackay2-Apr-09 9:21
Colin Angus Mackay2-Apr-09 9:21 
GeneralRe: DrawLine on Panel? Not saving? Pin
Jacob Dixon2-Apr-09 9:23
Jacob Dixon2-Apr-09 9:23 
GeneralRe: DrawLine on Panel? Not saving? Pin
Colin Angus Mackay2-Apr-09 9:31
Colin Angus Mackay2-Apr-09 9:31 
GeneralRe: DrawLine on Panel? Not saving? Pin
Jacob Dixon2-Apr-09 9:48
Jacob Dixon2-Apr-09 9:48 
QuestionBinding in-memory data to a DataGridView Pin
StevenS_Dev2-Apr-09 8:38
StevenS_Dev2-Apr-09 8:38 
AnswerRe: Binding in-memory data to a DataGridView Pin
Mycroft Holmes2-Apr-09 11:04
professionalMycroft Holmes2-Apr-09 11:04 

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.