|
all you have to do is change
listBox1.Items.Add(attrColl[0].Value + "\t" + ordersList[i].FirstChild.InnerText + "\t");
to
listBox1.Items.Add(attrColl[0].Value + "\t" + ordersList[i].InnerText + "\t");
hope it helps
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
Thanks a lot for your answer.
Well, you see, what I want to do is to get them one by one so to speak..
I want to have the four first "children" in the listbox and do some
other stuff to the other ones.. So I need to split them all somehow,
I have no idea how though..
|
|
|
|
|
Try looping through all the child nodes of each Order node, like so:
for(int i = 0; i < ordersList.Count; i++){
XmlNode child = ordersList[i].FirstChild;
for(int j = 0; j < ordersList[i].ChildNodes.Count; j++){
listBox1.Items.Add(child.Name + "\t" + child.InnerText + "\t");
child = child.NextSibling;
}
}
The key here is child = child.NextSibling. I think this might be what you're after.
Dybs
|
|
|
|
|
Thanks a lot, that did it!
|
|
|
|
|
Actually, I just thought of a better approach. Instead of using
child = child.NextSibling
Just use
ordersList[i].ChildNodes[i]
No need for the NextSibling bit.
Dybs
|
|
|
|
|
In the addetion to manipulate throgh the xml, you can deserialize the xml to an entity then manipulate the entity, I find it this way more readable, unless there is not much of data manipulation you have.
Sincerely Samer Abu Rabie
Note: Please remember to rate this post to help others whom reading it.
|
|
|
|
|
|
|
That's because your SMTP server doesn't allow mail relay. The from address has to be an account on the SMTP server, or it won't send.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Good Day,
My organization (School Club) will give a seminar. All attendees will get a certificate for attending the seminar.
All of the Attendees information will be saved on a database.
Basically, the Certificate was already designed using Photoshop. However, details like Name, Control Number and Date Printed needs to be filled-up.
I'm thinking of having 3 textboxes placed on top of the Imagebox (the Certificate Image), filling the textboxes with the name, control number and date, and then printing it. However, I don't know how to proceed.
What can you guys suggest?
Thanks!
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
I think you should use Crystal Report. Design your Certificate on Crystal Report [ that alredy designed as image ] please Value field and Print !!!!
|
|
|
|
|
Abhijit Jana wrote: should use Crystal Report
He could, but it might not be cost-wise beneficial for him since it for the school club. Clubs are usually on a tight budget of what they can spend. You might want to suggest something freeware for him to check out.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
You could just do something along the lines of using the PrintDocument class in your app for adhoc reporting. If not, there are plenty of free reporting tools out there, this google search on freeware reporting tools for .net[^] turned up a few good ones. Report Sharp Shooter Express is a nice one.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hi,
I am using Save As Dailog box in my application. On running the application, when i try to save a file using Save As dialog box, i found a strange problem. When selecting "My computer" directly, the drives ( c:, d: ) are not visible. however when clicking on drop down box, the whole tree is visible(i.e My Desktop--> My Computer --> C:, D: etc). on doing some r&d i found out that this problem is with OS Windows XP only as with other OS, the above problem doesnt exists. Further my application applies MTA apartments.On shifting to STA, it works fine even with XP OS. Please help me out as i am bound to use Windows XP and MTA.
Regards
Saumik V
|
|
|
|
|
Hi, As i want the small example on how to write a function to insert an integer into a sorted array of integers using c#.Net. So can anybody help me in this regard?
|
|
|
|
|
Try this code;
public int[] InsertToArray(int[] arr, int myInt)
{
int index = 0;
<code>
if (myInt <= arr[0]) <code>
index = -1;
else if (myInt >= arr[arr.Length -1]) <code>
index = arr.Length-1;
else
{
for (int k = 0; k < arr.Length - 1; k++)
if (arr[k] <= myInt && myInt <= arr[k + 1])
index = k;
}
<code>
int[] newArr = new int[arr.Length + 1];
Array.Copy(arr, 0, newArr, 0, index + 1);
newArr[index+1] = myInt;
Array.Copy(arr, index + 1, newArr, index + 2, arr.Length - index - 1);
return newArr;
}
zafer
|
|
|
|
|
Hi Zafer,
Thank you for your assistance.
Regards,
Sami.
|
|
|
|
|
Creating a new array seems rather inefficient.
Instead you should test to see if the value will fit and only extend the array (or throw an Exception) if the new value won't fit.
Edit: Oh, right, an array doesn't keep track of how many items you have in it... you'll need to track that on your own.
modified on Saturday, August 23, 2008 10:44 AM
|
|
|
|
|
And perhaps copy to the new array while searching for the index.
|
|
|
|
|
Use a generic list, add all of your elements, and then call the list Sort() method.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I want to set and focus to a specified node in treeview.it means I want to go to specified node in treeview
How can I do it ?
Hello Friends
|
|
|
|
|
Iterate through your treeview until you find the one you need, then set the treeviews SelectedNode property and call the selectednode's EnsureVisible method.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
Simply you can find tree node within treeview using the find method as show below
string myNodeName="abc"
TreeNode[] node=new TreeNode[1];
node=treeView1.Nodes.Find(myNodeName,true);
treeView1.SelectedNode=node[0];
this is simple way how u can find your node within the treeview
Abdul Rahaman Hamidy
Senior Student Student in Computer Science
Kabul, Afghanistan
Software Developer
|
|
|
|
|
I HAVE ALREADY ANSWERED THIS. There is no reason to repost it.
Everything makes sense in someone's mind
|
|
|
|
|
I have a 512x512 image, and using lockbits and unsafe code, i visit each pixel to retrieve that pixel value. This is a grayscale image.
What i want to do is start the retrieval from the 256th pixel in each row (or, collectively, the right half of the image).
Heres what i tried:
inputImg = Image.FromFile(inputImgPath);
b = (Bitmap)inputImg;
BitmapData bmData = b.LockBits(new Rectangle(256, 0, b.Width, b.Height),
ImageLockMode.ReadWrite, PixelFormat.Format8bppIndexed);
int stride = bmData.Stride;
System.IntPtr Scan0 = bmData.Scan0;
unsafe
{
byte* p = (byte*)(void*)Scan0;
int nOffset = stride - 256;
for (int y = 0; y < b.Height; ++y)
{
for (int x = 0; x < 256; ++x)
{
current = (byte)p[0];
p++;
}
p += nOffset;
}
}
b.UnlockBits(bmData);
The problem is occurs when i use the LockBits method. The compiler says the parameter is not valid.
modified on Saturday, August 23, 2008 12:33 AM
|
|
|
|