|
|
0) UPDATE INTO -- nope
1) colErrByUserID = '" + LoginForm.gb_strUserID + "' "; -- very bad idea
|
|
|
|
|
Thanks for that!
Very useful, not!
So what you are really saying is you don't know...

|
|
|
|
|
No, I'm just not going to spoon-feed you. You'll find very few people here who will.
|
|
|
|
|
Thats right you, keep telling yourself that!

|
|
|
|
|
|
I am having an XMl like below
<Details>
<det id=1 name="abc">
</Details>
Now i want to take the above xml as input and to repeat the node
like below using C#
<Details>
<det id=1 name="abc"/>
<det id=2 name="abc"/>
<det id=3 name="abc"/>
</Details>
|
|
|
|
|
|
Rich,
Just I want to repeat the node in aloop by incrementing id.
|
|
|
|
|
I don't understand what your problem is. What code are you using to create the original XML, and what code have you tried to create the repeat items?
|
|
|
|
|
Rich,
In c#.Original xml is a string which I get like below
<details>
<detail id="1" name="x"/>
</details>
I want to take that xml string and to repeat the nodes
foreach xml nodes
<details>
<detail id="1" name="x"/>
<detail id="2" name="x"/>
<detail id="3" name="x/>
</details>
id=2 and id=3 is repeated.want to do it in C#
|
|
|
|
|
That can be easly done using XmlDocument.
You know that class? Have you already tried something or you want us to give all the code to you (that you won't get here, I'm afraid)?
|
|
|
|
|
kurangu wrote: In c#.Original xml is a string which I get like below
Where do you get this from, a const string, XmlReader, TextReader?
kurangu wrote: I want to take that xml string and to repeat the nodes
I ask again, what code have you tried; please help us to understand better what you are actually doing in your code?
|
|
|
|
|
HI,
It's a constant string.
string a =
"<SecDetails><Security PrimarySecID=\"abcd\" Price=\"12\"/></SecDetails>";
XmlDocument originalXml = new XmlDocument();
originalXml.LoadXml(a);
XmlNodeList nodelist = originalXml.SelectNodes("/SecDetails/Security");
foreach (XmlNode xn in nodelist)
{
here I should be able to repeat the node
for (int i=1; i<=10;i++)
{
I am struck here.
}
}
|
|
|
|
|
|
Now I'm even more confused, I don't see a relation between what you have posted here, and the XML statements from your original post.
If you are saying that you don't know how to format a string in C# then I suggest you look at the documentation for the String class.
If you are unsure of the Xml data formats then look at the items referred to by Mirko1980.
If you are having trouble understanding the for or foreach statements then take a look at the C# documentation.
|
|
|
|
|
Hello,
I wanted to make a small game.. but I noted that the (X,Y) of the mouse and the button, if you are at the same pixel, are different. Look at the picture:
Here I'm pointing in the center of the button (where the red point is..) and the (X,Y) of both of them are different:
http://i34.tinypic.com/2ur9nx3.jpg[^]
Here I'm out of the button and its the same (X,Y) (red point..):
http://i37.tinypic.com/311tatz.jpg[^]
So why is this happening, and most importantly, how to fix this?
Thanks.
|
|
|
|
|
I don't understand the question..
Why would the position of the button change? Only the position of the mouse cursor would change when you move the mouse...
|
|
|
|
|
I mean that when I put the mouse over the button, they both should have the same (X,Y).. but thats not happening..
Why is that?
|
|
|
|
|
I'd have to see some code, as I'm not able to duplicate your error.
|
|
|
|
|
I did a simple program just to check what was the problem.
The program:
private void Form1_MouseMove(object sender, MouseEventArgs e)<br />
{<br />
textBox1.Text=MousePosition.X.ToString();<br />
textBox2.Text = MousePosition.Y.ToString();<br />
textBox3.Text = button1.Location.X.ToString();<br />
textBox4.Text = button1.Location.Y.ToString();<br />
}
which will show the (X,Y) of the button and the mouse..
and the problem is that even if u aim at the same pixel (the mouse and the button..), the (X,Y) are not the same..
|
|
|
|
|
A few things, your mouse position won't update when you hover over the button as the event isn't triggered when the mouse is over the button, furthermore the button x,y is relative to the parent (form) where the mouse position is relative to the desktop.
This means the button location will never change, but if you move the form and put the mouse in the exact same position relative to the top left of the form, your x,y coordinates will vary.
I still don't quite understand what it is you are trying to do so I can't offer you a solution, but I can explain my observations of different behavior.
Again the location (x,y as you put it) is relative to the parent , so form position is very important.
|
|
|
|
|
is there a way to override this thing?
I mean, for example, both button and mouse have the same parent?
A picture, will check from the desktop or the form?
|
|
|
|
|
I haven't tested but I supposed you could throw a panel on the form, it can dock to its parent to have the same size no matter what the size of the form is..
Again I haven't tested this or ever had to use such a technique, so I would say it's all trial and error from here on in.
Good luck.
|
|
|
|
|
ok i will check it out,
Thank you for your help.
|
|
|
|