|
well you can load the xml document in dataset using dataset.ReadXML or you can load the xml document using xmldocument.load and then read the data using xpath or best thing is to google it[^]
-----
|
|
|
|
|
|
If the XML file is small, I would use Xml Serialization that will convert the textual xml file into an object which would be easy to read since it is an object.
If hte XML file is a complex large file, then you can use the XmlReader class that that you can traverse the structure and process it.
Either way, take a look MSDN website and you will find excellent examples that Microsoft provided you.
Microsoft Student Partner
|
|
|
|
|
My problem is how can I run C# programs.
Iam not Able to Install Dot net Visual studio C# on
Windows XP platform.
Would U pls Sir/Madam help me to find the way out.
Thanks in advance...
From Tesfatsion
|
|
|
|
|
You must install the relevant version of the .NET Framework on the target machine. This is a free download. You can also include it in your installation package so that it gets installed with your application.
|
|
|
|
|
Respect to you Colin. You doing a splendid job of answering the broadest possible questions this afternoon!
Regards,
Rob Philpott.
|
|
|
|
|
I am unable to run following source code using Lucene.Net.Dll 2.0.0.4 :
http://www.codeproject.com/useritems/Search_with_in_documents.asp
Main problems is that in this source file the author used to references of one class library name classlibrary.dll and the lucene.net.dll. I just want to run this projet using only lucene.net.dll.
Please help me.
|
|
|
|
|
I have three different C# applications that I have to put together as one. Any ideas?
a novice
|
|
|
|
|
Ofori Boadu wrote: I have three different C# applications that I have to put together as one. Any ideas?
Extract the code into class libraries (where they are not already) and create a new application that references these class libraries.
|
|
|
|
|
Ofori Boadu wrote: I have three different C# applications that I have to put together as one. Any ideas?
Well if that' all the requirements you have, you're screwed. That indicates you will be using the Software Rocks Process.
Someone gave you a project by telling you they want you to get them a rock. You run off and find one and bring it back and they look at it and say "Oh no I wanted a larger rock". So you run off again and find a larger rock and bring it to them and they say "Oh no I wanted a flatter rock". So you run off again and find a flatter rock and bring it to them and they say "Oh no I wanted a smoother rock". So you run off again and.... well you get the point.... I hope, good luck.
|
|
|
|
|
I could do with some feedback on some development I am doing.
I am writing a class to return file information within a directory.
The class allows a recursive search of the directory - so the class will enable you to pull all the file information, for instance, from the C: drive or a mapped network drive.
Originally I tried the System.IO.Directory class however I found that the GetFiles method fell over with exceptions on certain files (system files, etc...).
The class I am writing threads the searching so that one can access file information as it is being found (searching C: can take a couple of minutes!).
Have I gone to the trouble of creating a class for which there is already a solution?
Regards
Guy
You always pass failure on the way to success.
|
|
|
|
|
If the built in File and Directory classes are failing you then the native Windows API will surely have the answer.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Thanks,
I used Directory.GetFiles and Directory.GetDirectories class/methods to recurse through the directory structure.
My question was more that this is such an common thing, getting file information recursively, that I was wondering if a class that could do this existed.
Regards
Guy
You always pass failure on the way to success.
|
|
|
|
|
Have you looked into the DirectoryInfo class which has recursive methods?
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Thanks Ennis,
I'll check it out.
Regards
Guy
You always pass failure on the way to success.
|
|
|
|
|
I found a good article at clickety.
However in the end I think I got it right(for my purposes) - as I have found using recursion fills the stack up pretty quickly when recursing through a large directory structure.
Thanks for your help,
Guy
You always pass failure on the way to success.
|
|
|
|
|
Hi,
well you can also handle that exception, or?
<br />
try{<br />
code where the exception occoures<br />
}<br />
catch (Exception e)<br />
{<br />
handle the exception, or just log it somewhere<br />
}
regards, Tobias
|
|
|
|
|
Thanks Tobias,
Yes I used this sort of exception handling with the class/methods I used.
Regards
Guy
You always pass failure on the way to success.
|
|
|
|
|
Hi I have a listview on my windows form with a details view. The listview has to columns and many items. These items and subitems are add to the listview in the form load event. The item are also put in s specific order. I then want to find an item in the second column and then select this item and give it focus.
Can anyone give me any suggestions or where I can find good examples of listviews?
Lucy
|
|
|
|
|
|
Hi thank you for the link. I was trying to go about this a different way but I found the answer before your reply using trial and error, Here is my form load event and the last if statement finds the item:
RegistryKey key = Registry.LocalMachine.OpenSubKey("RegKey_test", true);<br />
RegistryKey k = key.OpenSubKey("Classification");<br />
if (k != null)<br />
{<br />
string[] names = k.GetValueNames();<br />
<br />
for (int i = 0; i < k.ValueCount; i++)<br />
{<br />
int values = Convert.ToInt32(k.GetValue(names[i], ""));<br />
ListViewItem item1 = new ListViewItem();<br />
ListViewItem.ListViewSubItem item2 = new ListViewItem.ListViewSubItem();<br />
item1.Text = names[i];<br />
item2.Text = Convert.ToString(values);<br />
item1.SubItems.Add(item2);<br />
listView1.Items.Add(item1);<br />
}<br />
}<br />
<br />
if (key.GetValue("Threshold") != null)<br />
{<br />
string KeyValue = Convert.ToString(key.GetValue("Threshold", ""));<br />
ListViewItem itemFind = listView1.FindItemWithText(KeyValue, true, 0);<br />
if (itemFind != null)<br />
{<br />
itemFind.Selected = true;<br />
listView1.FocusedItem = itemFind;<br />
}<br />
}
I am not sure if this is user friendly yet as the second column of the listview may be taken out so that the values cannot be seen by the user. I would then need a new ways to find the value needed to select the appropriate item.
Lucy
|
|
|
|
|
I am trying to display multiple images in a single picture box control. Any ideas?
a novice
|
|
|
|
|
Your picture box has an image associated with it. The image can be anything including one created in memory. Create a Bitmap (which is a type of image) in memory and draw the multiple other images into it in the appropriate place with the appropriate size.
Upcoming FREE developer events:
* Developer! Developer! Developer! 6
* Developer Day Scotland
My website
|
|
|
|
|
If you are going to show more than one images on a single picture box, you may try creating a new image containing all images which you want to show.
Following code will show two images img1.jpg and img2.jpg on the same picture box, by drawing them on a third image; second image will be drawn at the bottom of the first image-
-----------------------------Start Code-----------------------------
System.Drawing.Bitmap MergedImage;
System.Drawing.Image Image1 = Image.FromFile("C:\\img1.jpg");
System.Drawing.Image Image2 = Image.FromFile("C:\\img2.jpg");
if (Image1.Width > Image2.Width)
{
MergedImage = new Bitmap(Image1.Width, Image1.Height + Image2.Height);
}
else
{
MergedImage=new Bitmap(Image2.Width,Image1.Height + Image2.Height);
}
Graphics g = Graphics.FromImage(MergedImage);
g.DrawImage(Image1, 0, 0);
g.DrawImage(Image2, 0, Image1.Height);
this.pictureBox1.Image = MergedImage;
g.Dispose();
--------------------------------------End Code-------------------------------
I hope this helps .
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
Thank you Dave I tried it and it worked perfectly.
a novice
|
|
|
|