Click here to Skip to main content
15,905,616 members
Home / Discussions / C#
   

C#

 
GeneralRe: Overlay Icons in ListView Pin
Heath Stewart22-Oct-03 12:20
protectorHeath Stewart22-Oct-03 12:20 
GeneralRe: Overlay Icons in ListView Pin
Heath Stewart22-Oct-03 12:44
protectorHeath Stewart22-Oct-03 12:44 
GeneralColumn Name wrapping in Listview ! Pin
pahluwalia22-Oct-03 8:19
pahluwalia22-Oct-03 8:19 
GeneralRe: Column Name wrapping in Listview ! Pin
Heath Stewart22-Oct-03 9:40
protectorHeath Stewart22-Oct-03 9:40 
GeneralRe: Column Name wrapping in Listview ! Pin
pahluwalia22-Oct-03 10:26
pahluwalia22-Oct-03 10:26 
GeneralRe: Column Name wrapping in Listview ! Pin
Heath Stewart22-Oct-03 10:29
protectorHeath Stewart22-Oct-03 10:29 
GeneralRe: Column Name wrapping in Listview ! Pin
Stephane Rodriguez.22-Oct-03 11:50
Stephane Rodriguez.22-Oct-03 11:50 
GeneralSimplest of Things are Hard Pin
antoine@orchus-tech22-Oct-03 6:35
antoine@orchus-tech22-Oct-03 6:35 
Hi,

My Question Is: with regards to XML in a C# context.

For the record, I'm using VS 2002, running Win2000 dayly updated, cel400mhz,192ram,dotNET1.1

The Premices:

Put simply, I am trying to use XML as a relationnal database for an application.
I figured an XML schema, an XML file, and some code to plug it in and that was it.

The application is to store contacts information and more types of info
as we upgrade it. So what makes sense here is to have an XML file for each type of info.
The user needs to be able to do the usual, such as view, add, modify, delete entries.
The XML files should reside in the main application folder. Now, this is part of what I tried:
-please bare in mind I'm kinda new with xml...Wink | ;)

The Faulty Code:

        string item;<br />
	XmlDocument myDoc = new XmlDocument();<br />
<br />
	myDoc.Load(Application.StartupPath + "\\Contact.xml");<br />
<br />
	XmlNode myNode = myDoc.FirstChild;<br />
	item = myNode.FirstChild.InnerText.ToString();<br />
	txtFirstName.Text = item;



The Error Message:

An unhandled exception of type 'System.NullReferenceException'
occurred in Orchus_temp.exe Additional information: Object reference
not set to an instance of an object.



The Question Redux:

" How do I add, modify, view and delete data that is stored in an XML file and rendered in a C# application? "

I propose to write an article about the resolution of theses issues, since a
lot of people have to resolve these kind of problems, I believe.

So feel free to respond extensively as this will be the substace of my first article! Big Grin | :-D

Thanks!Smile | :)

Antoine Dubuc
Montreal, Canada




This by our hands that dream,
"I shall find a way or make one!"
GeneralRe: Simplest of Things are Hard Pin
leppie22-Oct-03 7:02
leppie22-Oct-03 7:02 
GeneralRe: Simplest of Things are Hard Pin
Philip Fitzsimons22-Oct-03 7:57
Philip Fitzsimons22-Oct-03 7:57 
GeneralRe: Simplest of Things are Hard Pin
antoine@orchus-tech22-Oct-03 18:36
antoine@orchus-tech22-Oct-03 18:36 
GeneralRe: Simplest of Things are Hard Pin
antoine@orchus-tech23-Oct-03 9:49
antoine@orchus-tech23-Oct-03 9:49 
GeneralIcon for EXE file Pin
Khang Nguyen22-Oct-03 6:12
Khang Nguyen22-Oct-03 6:12 
GeneralRe: Icon for EXE file Pin
Daniel M. Edwards22-Oct-03 8:33
Daniel M. Edwards22-Oct-03 8:33 
GeneralRe: Icon for EXE file Pin
Khang Nguyen22-Oct-03 9:31
Khang Nguyen22-Oct-03 9:31 
QuestionCreating Event ID's for Eventlog ? Pin
LongRange.Shooter22-Oct-03 6:11
LongRange.Shooter22-Oct-03 6:11 
GeneralCombobox index Pin
Mike Osbahr22-Oct-03 4:56
Mike Osbahr22-Oct-03 4:56 
GeneralWindows services Pin
Hambi22-Oct-03 2:37
Hambi22-Oct-03 2:37 
GeneralRe: Windows services Pin
Heath Stewart22-Oct-03 5:27
protectorHeath Stewart22-Oct-03 5:27 
GeneralPainting the title bar Pin
wangier21-Oct-03 23:41
wangier21-Oct-03 23:41 
Generalcontrol on Desktop Pin
vikramlinux21-Oct-03 22:19
vikramlinux21-Oct-03 22:19 
GeneralRe: control on Desktop Pin
Heath Stewart22-Oct-03 5:23
protectorHeath Stewart22-Oct-03 5:23 
GeneralRe: control on Desktop Pin
Bo Hunter22-Oct-03 12:35
Bo Hunter22-Oct-03 12:35 
GeneralRe: control on Desktop Pin
Heath Stewart22-Oct-03 12:52
protectorHeath Stewart22-Oct-03 12:52 
GeneralInternet Explorer` Pin
Srikar Y21-Oct-03 19:31
Srikar Y21-Oct-03 19:31 

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.