473,396 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Read XML from application variable instead of file

gn
Due to the production servers being a multiple server farm and not
being able to write xml files to them, I am having to change my
application to write to HttpContext.Current.Application("var")
I have succeeding in doing this part, my problem is now how to read
them. I kinda hoped that I would be simply able to change

m_xmlr = New XmlTextReader(path/var.xml"))

to

m_xmlr = New
XmlTextReader(HttpContext.Current.Application("var ").ToString)

here is my current code - what changes would I need to make?

m_xmlr = New XmlTextReader(path/var.xml"))
'Disable whitespace so that you don't have to read over
whitespaces
m_xmlr.WhitespaceHandling = WhitespaceHandling.None
'read the xml declaration and advance to family tag
m_xmlr.Read()
'Load the Loop
While Not m_xmlr.EOF
'Go to the name tag
m_xmlr.Read()
'if not start element exit while loop
If Not m_xmlr.IsStartElement() Then
Exit While
End If
m_xmlr.Read()
Dim C_TitleValue As String =
m_xmlr.ReadElementString("C_TITLE")
'Get the comment Element Value
Dim C_CommentValue As String =
m_xmlr.ReadElementString("C_COMMENT")
'Get the URL Element Value
Dim C_URLValue As String =
m_xmlr.ReadElementString("C_URL")
'Get the listorder Element Value
Dim C_ListorderValue As String =
m_xmlr.ReadElementString("C_LISTORDER")
'Iterate through writing values from XML file into the
table string

thanks so much, as always I am on a deadline

Nov 19 '05 #1
3 1599
if I know my vb well enough.

m_xmlr = New XmlTextReader(new
StringReader(HttpContext.Current.Application("var" ).ToString))

you do know that HttpContext.Current.Application is local to the server, and
not shared across a web farm

-- bruce (sqlwork.com)

<gn@dana.ucc.nau.edu> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
| Due to the production servers being a multiple server farm and not
| being able to write xml files to them, I am having to change my
| application to write to HttpContext.Current.Application("var")
| I have succeeding in doing this part, my problem is now how to read
| them. I kinda hoped that I would be simply able to change
|
| m_xmlr = New XmlTextReader(path/var.xml"))
|
| to
|
| m_xmlr = New
| XmlTextReader(HttpContext.Current.Application("var ").ToString)
|
| here is my current code - what changes would I need to make?
|
| m_xmlr = New XmlTextReader(path/var.xml"))
| 'Disable whitespace so that you don't have to read over
| whitespaces
| m_xmlr.WhitespaceHandling = WhitespaceHandling.None
| 'read the xml declaration and advance to family tag
| m_xmlr.Read()
| 'Load the Loop
| While Not m_xmlr.EOF
| 'Go to the name tag
| m_xmlr.Read()
| 'if not start element exit while loop
| If Not m_xmlr.IsStartElement() Then
| Exit While
| End If
| m_xmlr.Read()
| Dim C_TitleValue As String =
| m_xmlr.ReadElementString("C_TITLE")
| 'Get the comment Element Value
| Dim C_CommentValue As String =
| m_xmlr.ReadElementString("C_COMMENT")
| 'Get the URL Element Value
| Dim C_URLValue As String =
| m_xmlr.ReadElementString("C_URL")
| 'Get the listorder Element Value
| Dim C_ListorderValue As String =
| m_xmlr.ReadElementString("C_LISTORDER")
| 'Iterate through writing values from XML file into the
| table string
|
| thanks so much, as always I am on a deadline
|
Nov 19 '05 #2
gn
you do know that HttpContext.Current.Application is local to the
server, and
not shared across a web farm

from what I understand in our case that is stored in a sql server,
though I could be wrong?

Nov 19 '05 #3
gn
Your solution to the original question worked great by the way.

Thanks so much!

Won't get to test it on the server farm until I am ready to promote to
production, not an ideal setup but not my choice

thanks again

Nov 19 '05 #4

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

Similar topics

2
by: fabrice | last post by:
hello, Is it possible to read a registry key in ASP, and use the value in an application via a session variable. I'm using II6 on windows server 2003. I'd like to create a key in the registry...
4
by: Keith Chadwick | last post by:
I am having some trouble referencing an Application("myVar") variable from within a module.vb file on my ASP.NET site. According to the documentation I should be able to reference...
7
by: Greg Collins [MVP] | last post by:
Hi, I couldn't find what I was looking for by searching the newsgroup, but perhaps these have already been discussed somewhere. This is a bit long with a lot of interrelated questions. What I've...
5
by: Sridhar | last post by:
Hi, I have created a project which contains classes to read the data from the database. This project has an App.Config file which contains the SqlConnection String. when this code is called from...
2
by: Stefan Huber | last post by:
Hi I've got a really strange problem, and can't find out why it's not working as intended. in order to use php4 and 5 together on a webserver and the requirement for running as different...
3
by: Yaniv | last post by:
Hi I'm new in VB.NET. I wrote an application which opens a text file and read it all lines untill the EOF this file is open for read only and for sharing asllowed. every 5 seconds another...
3
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
I try to follow Steve's paper to build a database, and store a small text file into SQL Server database and retrieve it later. Only difference between my table and Steve's table is that I use NTEXT...
2
by: RyanS09 | last post by:
Hi- I have read many posts with specific applications of reading in text files into arrays, however I have not been able to successfully modify any for my application. I want to take a text file...
2
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
Hi Is there any way to Read an INIFile from a string or Stream instead of a physical file ??? I want to read the INIFile into a string then store in a db but when I read the string from the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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...
0
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,...

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.