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. } }
kurangu
Posts
-
Repeat XML node -
Repeat XML nodeRich, 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#
-
Repeat XML nodeRich, Just I want to repeat the node in aloop by incrementing id.
-
Repeat XML nodeI 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>
-
Datetime in sqlserverfolks, I have a table with column upddate with datatype as datetime. I updated the table update table set upddate=getdate() when i select the values all the upddates are same. I expected difference in milli seconds to find the last updated record. can somebody help me out.
-
Getting values from two tables.HI, It will just combine the values.I need in columns like #hy1.childname #hy1.ror #hy.childname #hy.wgt without altering the sorting.
-
Getting values from two tables.Hi, I have two tables like below. select childname,wgt from #Hy order by wgt desc select childname,ror from #Hy1 order by ror desc I need like below. #Hy.childname #HY.wgt #Hy1.childname #hy1.ror Just like appending the two tables without altering the result set means first one should be wgt desc and ror should be desc.
-
Remove decimal with out rounding.HI, if i do like that select convert(decimal(18,3),(-0.0268000000000000000)*1000/1000) I am getting -0.027 which is again rounding.can you help me how to truncate the value with out rounding.
-
Remove decimal with out rounding.Hi, I am using sql 2005.I have a value -0.026880000000000 but I want the result as -0.0268 just 3 decimals.If I use select convert(decimal(18,3),-0.026880000000000) I am getting -0.027 with rounded. can anybody help me out in this. Thx
-
Byte array into Excel using C#.string sfilename = @"C:\\\\test.xls"; FileStream fs = new FileStream(sfilename, FileMode.Create); xlw.Save(wb, fs); byte[] binFile = new byte[fs.Length]; fs.Read(binFile, 0, (int)fs.Length); fs.Close(); return binfile. Mike the above code returns the byte(right now I am saving the excel file with test.xls in server) after that i am getting the byte. client coe:- ----- byte[]test=webservice.getdata(); FileStream output = new FileStream("C:\\test2.xls", FileMode.Create,FileAccess.Write); output.Write(test, 0, test.Length); output.Close(); Test 2 created with the same size as test in server but when i open I am geeting format not good.with empty xls.
-
Byte array into Excel using C#.Mike, It's an bytes of excel file.But when I write in client side.Not able to open the excel file.It says not in recognizable format is there any format getting changed by webservice.
-
Byte array into Excel using C#.I am having a webservice which creates an excel file in server and sends back it as byte array. Now i want to write that byte arry in excel file in the client side.can any body help me out.It's an winform application.
-
ADODB in C#Folks, In one of my requirement I have to use ADODB(since I need old method recordset)in c#.I am trying to execute stored proc I don't know how to pass parameters from c# to adodb can anyone help me. rs=cmd.execute(out object recordsaffected,ref object parameters,int options) can somebody help me how to pass ref object parameters with some sample. Thanks kingston
-
Using IEnumerator in C#Hi, We can loop through collection using foreach and IEnumerator.Can any body help me when to use foreach and when to use Ienumerator since both will loop through collection and get the result?
-
Delegate Beginner stageRobert, Thank you very much Now I understood filly.Thanks again for helping in this concept
-
Delegate Beginner stageCan some one help me out of understanding the delegate. we are calling some method with delegate object. program t1=new program() delegateabc d1 = new delegateabc(t1.Testabc); Here I am calling the method Testabc from class program. I don't understand what is the benefit of calling through delagate I can directly use t1.testabc not going through delagte. can someone help me ou with the difference. t