|
You are most welcome.
you can also rate the answers if it really helped you ..
|
|
|
|
|
I have a large xml document and I am extracting out individual nodes from it. I don't want any manipulation.
its like
start-large
start-small
.
.
close-small
start-small
.
.
close-small
and so on.
It works fine if I do.
XmlDocument xmlDoc= new XmlDocument();
xmlDoc.Load(xr.ReadSubtree());
xmlDoc.Save("c:\\one.xml");
But for the following the XMl document I get it messed up.
XmlTextWriter xw = new XmlTextWriter("C:\\two.xml", null);
xw.WriteNode(xr.ReadSubtree(), true);
I get errors like "end element missing" or "not properly closed".
What am I doing wrong in case of text writer? xr is the xmltextReader which is reading the large file.
Your help is appreciated.
|
|
|
|
|
Check if all your begin tags have closing tags in your XML file.
|
|
|
|
|
can someone explain if i need to use all the three lines of code mentioned below to disable the cache in a page.actually if i am using only Response.CacheControl = "no-cache" then also page is working properly.then what is the use of another two line..and also is it a server side cache or client side?
Response.CacheControl = "no-cache"
Response.AddHeader("Pragma", "no-cache")
Response.Expires = -1
|
|
|
|
|
If you are talking about ASP.NET, then please post it in ASP.NET forum
|
|
|
|
|
How i can get Hardware seail number of hard disk byc# code?
|
|
|
|
|
If you google using serial instead of seail, you will find many results.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
mht2008 wrote: How i can get Hardware seail number of hard disk byc# code?
You can read it easily using WMI .
Try this
using System.Management
Public string GetHDDSerialNumber(string drive)
{
if (drive == "" || drive == null)
{
drive = "C";
}
ManagementObject disk = new ManagementObject("win32_logicaldisk.deviceid=\"" + drive +":\"");
disk.Get();
return disk["VolumeSerialNumber"].ToString();
}
Source : Use WMI to get HDD's serial number
Note : You have to add System.Management.Dll from Reference
[EDIT]
For Exploring WMI : Please Download WMI Code Creator
[/EDIT]
Hope this will help you
|
|
|
|
|
|
Thanks
|
|
|
|
|
|
How i can export and import sql server 2005 database by c# code?
|
|
|
|
|
Not being funny but maybe buying a book would help??
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Any reason you specifically want to do it in C#? SSIS is probably more suited for what you're looking to do.
Cheers,
Vikram. (Proud to have finally cracked a CCC!) Recent activities:
TV series: Friends, season 10
Books: Fooled by Randomness, by Nassim Nicholas Taleb. Carpe Diem.
|
|
|
|
|
How about looping all tables from the database. (export)
Saving them in an xml document. (export file)
And then saving them back to another database. (import)
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
How i can define dyamic array in c#?
|
|
|
|
|
Use a List?
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
System.Collections.ArrayList al = new ArrayList();
Then for every element you want to add just use the a1.Add method.
|
|
|
|
|
Only if you are forced to use .NET 1.1
|
|
|
|
|
As HArold said, only if forced to use 1.1. The problem with an ArrayList is it requires every object to be converted to and from object (boxing/unboxing). A List<T> gives the same functionality, but without that overhead and inconvenience!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Ah, okay, gotcha! I was typing asking why it was bad!
Thanks for the tip!
|
|
|
|
|
I have made a custom Scroll Bar somewhat like the one here How to skin scrollbars for Panels, in C#[^].
My Goal is to insert this control inside of a treeview and get rid of the standard scrollbar. I have been working and looking around for answers for two weeks. Could someone please help me out or at least point me in the correct direction
Mike
|
|
|
|
|
Hi Guys,
Hope someone can help with this little problem I have because its driving me mad.
I need to calculate the period in which a date falls
so lets say a companies financial years starts on 1st Jan then
Jan = P1, Feb = P2 etc etc
That makes finding the period quite easy, i just take the month of the transaction.
The problem I'm having is when the FY starts on say 1st April 2009 then
Apr = P1, May = P2 etc etc
So .
15/06/2009 returns P3/2009
01/08/2009 returns P5/2009
but
15/01/2009 returns P10/2008
So far I'm using this
'Holds the date which financial year starts
Dim FYstart As Date = = CDate("01/04/2000")
'Move FYStart to current year
FYstart = DateValue(FYstart.Day & "/" & FYstart.Month & "/" & TranDate.Year)
'Months difference between transaction date and FYstart
Dim MonthDiff As Integer = -DateDiff(DateInterval.Month, TranDate, FYstart)
'Years different between the 2 dates
Dim YearDiff As Integer = Math.Truncate(MonthDiff / 12)
'Period number
Dim p As Integer
If MonthDiff <= 0 Then
p = 12 + (MonthDiff)
Else
p = MonthDiff
End If
Period = p
Year = TranDate.Year + YearAdj
Anyone have any pointers because everytime I think I've cracked it, I try a different FY Start / Tran Date combination and it gives me wrong answer
thanks in advance,
Daniel
|
|
|
|
|
Oops - you posted in the C# forum!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
drodgers wrote: but
15/01/2009 returns P10/2008
This is right. January is the tenth month of the 2008/09 tax year.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|