473,847 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XML file loaded and stored as cached dataset?

Have loaded balanced web servers that we do not allow to connect to our
database. Content is created and pushed to these sites. I want to add a web
service that may get multiple requests a second depending on peak access. I
have built an XML file from SQL DB and pushed this file to web server. I
want to load XML file at application startup and leave it cached if possible
(it will vary in size from 1-2MB) and treat it like an SQL table (rows &
columns) that I can filter on and send XML subset back to caller. Maybe I
should keep XML document loaded as XML Doc and pull my nodes/data from there
and send it out.

I'm concerned also about limitations caused by concurrent access to data.

regards,

doug
Mar 16 '07 #1
7 3368
Hi Doug,

Have you considered loading data from XML file as Dataset and caching it?
About how to load dataset from xml, you can reference.
http://msdn2.microsoft.com/en-us/library/fx29c3yd.aspx
[Loading a DataSet from XML]

If you use XML document rather than Dataset, I think you will lose many
useful features such as relationships, primary key, foreign key, and the
data type...
Additionally, It will become very difficult for you to get related rows.
You will lose the ability to know what type for each column. ..

Have a great weekend,
Sincerely,
Wen Yuan

Mar 16 '07 #2
I'll give it a try. Thanks. May take a few days to respond back.

doug

""WenYuan Wang"" wrote:
Hi Doug,

Have you considered loading data from XML file as Dataset and caching it?
About how to load dataset from xml, you can reference.
http://msdn2.microsoft.com/en-us/library/fx29c3yd.aspx
[Loading a DataSet from XML]

If you use XML document rather than Dataset, I think you will lose many
useful features such as relationships, primary key, foreign key, and the
data type...
Additionally, It will become very difficult for you to get related rows.
You will lose the ability to know what type for each column. ..

Have a great weekend,
Sincerely,
Wen Yuan

Mar 16 '07 #3
I have asked our web support group to verify thier standards are current.
Current standards state "absolutely NO View State" and Datasets should NOT be
used for web service or any high performance tasks. Is their another option?
Recall, no direct access to RDBMS, just a pre-built and staged XML file to
filter on to send XML packet response.

doug

""WenYuan Wang"" wrote:
Hi Doug,

Have you considered loading data from XML file as Dataset and caching it?
About how to load dataset from xml, you can reference.
http://msdn2.microsoft.com/en-us/library/fx29c3yd.aspx
[Loading a DataSet from XML]

If you use XML document rather than Dataset, I think you will lose many
useful features such as relationships, primary key, foreign key, and the
data type...
Additionally, It will become very difficult for you to get related rows.
You will lose the ability to know what type for each column. ..

Have a great weekend,
Sincerely,
Wen Yuan

Mar 20 '07 #4
Hi Doug,
Thanks for your reply.

As far as I know, we have four choices for your scenario.
(DataSet/DataTable, XMLDocument/ XmlReader, XMLDataDocument , XML
Serialization). DataSet is the way to represent data as relational view
and XMLDocument is another way to represent data as hieratical view.
Additionally, the XmlDataDocument class is derived from the XmlDocument
class, providing a hierarchical view of data as well as a relational view
by binding it to a DataSet. The primary purpose of XML serialization in the
..NET Framework is to enable the conversion of XML documents and streams to
common language runtime objects and vice versa.

In general, I would like to suggest you consider using DataSet/DataTable,
but it seems like your current standards restrict you from
DataSet/DataTable. However, now, the choices for us are
XMLDocument/XMLReader and XML serialization, as you said in initial post.
XMLTextReader is the fastest way to get the data via the pull-model XML
parsers.

I noticed there is a question very closed to your issue in WebQA article. I
highly recommend you may reference it.
http://msdn.microsoft.com/msdnmag/issues/02/12/webQA/
Q I'm looking for tips on getting the best performance from my use of the
System.Xml classes in an ASP.NET Web Service. Would I see a benefit from
long-term caching and reuse of System.Xml objects, like XmlDocument?

Additionally, you may meet an issue when using XmlDocument elements passed
to or returned from WebMethods. The following KB will tell the story for
you.
http://support.microsoft.com/kb/330600

Hope this helps. If you still have anything unclear, please feel free to
update here.
Have a great day,
Sincerely,
Wen Yuan

Mar 22 '07 #5
Wen Yuan,

Okay, got web service loading up XML file into dataset and I can send
dataset back to new XML document and return that as my result.

I have 5 layers on my XML. Users will want to select specific level 2 and
level 3 nodes plus child nodes 4 and 5, and parent 1. They will be passing
in an XML packet that has filter criteria level2='6' and level3='B'. I
assume I will load this into dataset also and use the two datasets maybe as a
join where node level values are equal?

How do I select rows from the dataset?

So far, not much code. Very clean. I am enjoying the project.

doug
""WenYuan Wang"" wrote:
Hi Doug,
Thanks for your reply.

As far as I know, we have four choices for your scenario.
(DataSet/DataTable, XMLDocument/ XmlReader, XMLDataDocument , XML
Serialization). DataSet is the way to represent data as relational view
and XMLDocument is another way to represent data as hieratical view.
Additionally, the XmlDataDocument class is derived from the XmlDocument
class, providing a hierarchical view of data as well as a relational view
by binding it to a DataSet. The primary purpose of XML serialization in the
.NET Framework is to enable the conversion of XML documents and streams to
common language runtime objects and vice versa.

In general, I would like to suggest you consider using DataSet/DataTable,
but it seems like your current standards restrict you from
DataSet/DataTable. However, now, the choices for us are
XMLDocument/XMLReader and XML serialization, as you said in initial post.
XMLTextReader is the fastest way to get the data via the pull-model XML
parsers.

I noticed there is a question very closed to your issue in WebQA article. I
highly recommend you may reference it.
http://msdn.microsoft.com/msdnmag/issues/02/12/webQA/
Q I'm looking for tips on getting the best performance from my use of the
System.Xml classes in an ASP.NET Web Service. Would I see a benefit from
long-term caching and reuse of System.Xml objects, like XmlDocument?

Additionally, you may meet an issue when using XmlDocument elements passed
to or returned from WebMethods. The following KB will tell the story for
you.
http://support.microsoft.com/kb/330600

Hope this helps. If you still have anything unclear, please feel free to
update here.
Have a great day,
Sincerely,
Wen Yuan

Mar 28 '07 #6
Hi Doug,
Thanks for your reply.

Dataset will load the xml file into datatables.
For each table, you can select the rows by the method DataTable.Selec t()
http://msdn2.microsoft.com/en-us/library/det4aw50.aspx
[DataTable.Selec t Method (String) ]

Additionally, get the rows( from Child/Parent table) related to your
selected rows.
DataRow.GetChil dRows
http://msdn2.microsoft.com/en-US/library/hbt8xha8.aspx

DataRow.GetPare ntRows
http://msdn2.microsoft.com/en-us/library/7bssayw4.aspx

Hope this helps, please feel free to let me know if you still have anything
unclear. I'm glad to assist you.
Have a great day,
Sincerely,
Wen Yuan

Mar 29 '07 #7
This is kind of what I imagined, but hoped it would be simplier. Will give
it a try.

Thanks.

"WenYuan Wang [MSFT]" wrote:
Hi Doug,
Thanks for your reply.

Dataset will load the xml file into datatables.
For each table, you can select the rows by the method DataTable.Selec t()
http://msdn2.microsoft.com/en-us/library/det4aw50.aspx
[DataTable.Selec t Method (String) ]

Additionally, get the rows( from Child/Parent table) related to your
selected rows.
DataRow.GetChil dRows
http://msdn2.microsoft.com/en-US/library/hbt8xha8.aspx

DataRow.GetPare ntRows
http://msdn2.microsoft.com/en-us/library/7bssayw4.aspx

Hope this helps, please feel free to let me know if you still have anything
unclear. I'm glad to assist you.
Have a great day,
Sincerely,
Wen Yuan

Mar 29 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2209
by: DJTB | last post by:
Hi, I'm trying to manually parse a dataset stored in a file. The data should be converted into Python objects. Here is an example of a single line of a (small) dataset: 3 13 17 19 -626177023 -1688330994 -834622062 -409108332 297174549 955187488 589884464 -1547848504 857311165 585616830 -749910209 194940864 -1102778558 -1282985276 -1220931512 792256075 -340699912 1496177106 1760327384
4
443
by: JASV | last post by:
We are opening an excel file using a dataadapter object. The tables included in excel file are loaded into a dataset object. This process works correctly except for this issue: There is an "Comment" field included in the excel sheet with 255 characters, but the dataset only read 64 characters. Have any idea to solve this problem?
1
5880
by: DraguVaso | last post by:
Hi, I found some examples for storing the FormSettings of a Form in an XML-file, but none of these could match my criteria: What I am looking for is the possibility to save the FormSettings of multiple Instances of 1 form. I have a Form frmSource from which I have multiple Instances, each with a unique Identifier. So when I Load or Close a specific instance, I want to load or save the Settings (Top, Height, Width, etc) in an XML-file....
2
1413
by: ALPO | last post by:
ANy good examples of paging against a cached dataset. Our datasets will be cached in viewstate.
5
7784
by: Guadala Harry | last post by:
This has to be easy... I have a DataSet stored in the Session object. I simply need to read it later and get the following error: Cannot implicitly convert type 'object' to 'System.Data.DataSet' From a code-behind module of an ASPX page, how do I read the contents of a DataSet that is stored in the Session? Thanks in advance.
0
1083
by: JenHu | last post by:
Hi experts, I am having trouble calling the cached dataview session and dataview.rowfilter session in the pageIndexChanged event. Currently, if user goes to page 2, the datagrid displays data without the rowfilter that user selected from 5 dropdownlists. I received the exception error on the code I wrote for calling the cached session in PageIndexChanged: Exception Details: System.NullReferenceException: Object reference not
0
1009
by: Craig G | last post by:
is there something im doing wrong?? the dataset is cached up until i click a button then when i try to retrieve it, it justs says its nothing!! this is code where it gets inserted into the cache Cache.Insert("myDS", dsResults, Nothing, System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromSeconds(300)) now if i query the cached dataset it shows that there is data in it!!
5
7881
by: mmcd79 | last post by:
I built a VB.net application that makes use of a machine level DB connection string setting, and a user level starting location setting. The machine level setting and the default user based setting is of course stored in the app.exe.config file located in the same directory as the exe. Upon closing the form, I save the user setting which then creates a user.config file in the appdata directory in my profile. This is all well and good....
17
2747
by: NeoAlchemy | last post by:
I am starting to find more web pages that are using a query parameters after the JavaScript file. Example can be found at www.opensourcefood.com. Within the source you'll see: <script src="/shared/scripts/common.js?revision=1.6" type="text/javascript">. I am trying to see if there is any big deal to this or a best practice that is starting to creep up in the JavaScript community. If this is used only as a way to distinguish what...
0
10643
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10705
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10330
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9477
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7879
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7050
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5716
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5907
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.