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.
I knew 3 and milliseconds came into, just couldn't remember where. I knew about datetime2 in 2008, but didn't realise so much time had been spent deciding on a name :-D
Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP
AFAIK that won't be possible using a single query and it will be problematic if the result sets have different amount of rows. For example, if the first result set is 10 rows and the second one is 20 row, the only way that comes in mind is something like: - insert the first sorted result set (10 rows) to a temporary table - add two columns to the temporary table - update the existing 10 rows with the first 10 rows of the second sorted result set - insert the rest 10 rows from the second sorted result set to the table in the columns 3 and 4. However this will lead to a situation where you have 20 rows but the column 1 and 2 for the last 10 rows will be null. It makes me wonder what is the use for this kind of result.
The need to optimize rises from a bad design.My articles[^]
I think they create a new file, then xls.Save(wb, fs); writes the actual spreadsheet to the file. After which they read the data back, which shouldn't be a problem i beleive...
My current favourite word is: Bacon!
-SK Genius
foreach uses the IEnumerator retrieved from GetEnumerator() on an object that implements IEnumerable. So, foreach is using IEnumerator internally anyway.
Scottish Developers events: * .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog