Parsing XML (freezing window)
I need to parse an XML file and insert the data into database.
The datafeed is located on remote server so it takes for a while and also the window is not responding while it parses the tags.
What do you suggest here? Multithreading maybe? I just don't want the browsers freezing while i parse the XML data.
Thanks
Re: Parsing XML (freezing window)
well use xslt...with 5...after reading xslt....you'll start chanting their name..
xslt will help you to parse any xml format to standard html + you can add css and blah blah!
to parse xml if you go by C# it will take a lot of time....if u r not gud with xml..
but xslt is something like [ The Faster Got Fastest...]
hope that helps...
Re: Parsing XML (freezing window)
well i am not good at XSLT but the time is not what i am concerned about here.
I just don't want it freezing during my C# code is parsing the XML data and saving into DB (sql server).
Please suggest something ... thanks
Re: Parsing XML (freezing window)
to save the data in the database in terms of xml and while reading it read it through xsl
select from survey_info for xml auto, elements; ...saving data to database and the next thing is use xsl..to get the data and go to w3schools.com...
it will take 30 mins..
and if no then...show me your code may be i can help..
and please don't forget to mention the flow of you code...
Re: Parsing XML (freezing window)
Ok i have my code and it works just FINE.
I JUST want to ask some gurus if MULTITHREADING would suit my needs.
That's all. However, thank you so much for the recommendation.
Re: Parsing XML (freezing window)
Are you parsing the XML in the codebehind (VB.NET/C#) or JavaScript?
If it's the codebehind and all you need is to insert the data into the database without a response from the database, then you can kick a thread off that requests and processes the XML; the execution will return to the main page and the page will return to the browser - the best you'll be able to do is tell the user that "The XML is being processed, should be ready in a few minutes."
To do this, look at ThreadStart.http://msdn.microsoft.com/en-us/libr...ebrequest.aspx
Re: Parsing XML (freezing window)
yeah it is codebehind. I will check the ThreadStart .. thank you so much for the link :)
Re: Parsing XML (freezing window)
Let us know if you get stuck. Threading is often daunting if you haven't used it before but it becomes so obvious when you start using it.