Click here to Skip to main content
15,921,941 members
Home / Discussions / C#
   

C#

 
GeneralUpdating Database Pin
Mazdak22-Oct-03 20:20
Mazdak22-Oct-03 20:20 
GeneralA question for the GURUs Pin
Anonymous22-Oct-03 20:13
Anonymous22-Oct-03 20:13 
GeneralRe: A question for the GURUs Pin
bjoernen22-Oct-03 22:06
bjoernen22-Oct-03 22:06 
GeneralChildWindow.Callback and NullReferenceException Pin
Anonymous22-Oct-03 19:37
Anonymous22-Oct-03 19:37 
GeneralRe: ChildWindow.Callback and NullReferenceException Pin
Guillermo Rivero23-Oct-03 4:32
Guillermo Rivero23-Oct-03 4:32 
GeneralRetrieving Table Cell Style from a Word Table using C# Pin
moriancumur22-Oct-03 18:20
moriancumur22-Oct-03 18:20 
GeneralRe: Retrieving Table Cell Style from a Word Table using C# Pin
Edbert P22-Oct-03 20:58
Edbert P22-Oct-03 20:58 
QuestionConverting a 20-page pdf to 20 single page pdf? Pin
NotProfessional22-Oct-03 15:00
NotProfessional22-Oct-03 15:00 
AnswerRe: Converting a 20-page pdf to 20 single page pdf? Pin
leppie23-Oct-03 9:17
leppie23-Oct-03 9:17 
GeneralRe: Converting a 20-page pdf to 20 single page pdf? Pin
mistery2225-Oct-03 3:20
mistery2225-Oct-03 3:20 
Generalprint page number, header and footer Pin
hkl22-Oct-03 14:33
hkl22-Oct-03 14:33 
GeneralSorting Pin
totig22-Oct-03 11:04
totig22-Oct-03 11:04 
GeneralRe: Sorting Pin
ankita patel22-Oct-03 11:25
ankita patel22-Oct-03 11:25 
GeneralRe: Sorting Pin
bjoernen22-Oct-03 22:11
bjoernen22-Oct-03 22:11 
GeneralOverlay Icons in ListView Pin
Heath Stewart22-Oct-03 9:47
protectorHeath Stewart22-Oct-03 9:47 
GeneralRe: Overlay Icons in ListView Pin
Stephane Rodriguez.22-Oct-03 12:11
Stephane Rodriguez.22-Oct-03 12:11 
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 

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.