473,386 Members | 1,702 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,386 software developers and data experts.

App Architecture ?

I am creating two services. One downloads XML streams from WebSphere MQ into
a SQL2K database, the other uploads XML Streams into Websphere MQ from
SQL2K. The upload service polls SQL2K every couple of minutes for uploads.
If there are uploads I create an ADO Dataset that I must convert to an XML
stream. The Dataset and the XML stream have different schemas, just to
clarify my dilema. I'm seeking input on the best way to convert ADO Datasets
to XML streams and vice versa, baring in mind their schemas are different. I
did a POC and "hard coded" each field to it's element. Surely, there's
another way. I have several of these to do and most have well over 100
fields. It would be nice to iterate through either the .xsd or the empty
..xml, and fill the .xml, utilizing a .xml based map, with the fields in the
ADO dataset. I am comfortable with the Document and Schema Object Models.
Any recommendations would be welcomed. Thanks in advance for your time.
Nov 28 '05 #1
1 977
DC
You can extract an XmlDocument from the DataSet, and can then apply an XSL
transform on it.
And of course, you can do the converse, too. examples:
http://samples.gotdotnet.com/quickst...lDocument.aspx

Have you tried this?

If you want to avoid the dataset and XSL on the DB-to-MQ path, there is an
FOR XML support in SQL2000, which allows you to extract whatever shape of
XML you like from a query. You can do something like this:

System.Xml.XmlTextReader xtr= null;
System.Xml.XmlDocument doc= null;
System.Data.SqlClient.SqlConnection dbconn= null;
try {
dbconn= GetDbConn();
System.Data.SqlClient.SqlCommand cmd= new
System.Data.SqlClient.SqlCommand(strSQL, dbconn);
cmd.Connection.Open();

xtr = (System.Xml.XmlTextReader) cmd.ExecuteXmlReader();
//xtr.WhitespaceHandling = System.Xml.WhitespaceHandling.None;
doc = new System.Xml.XmlDocument();
doc.Load(xtr);
//do whatever you like here
}
....

The FOR XML EXPLICIT can do basically what you describe here:
It would be nice to iterate through either the .xsd or the empty .xml, and
fill the .xml, utilizing a .xml based map, with the fields in the ADO
dataset.
....but it is being done by SQL Server. The query strings can get pretty
ugly, though. See here for some help and examples:
http://www.topxml.com/sql/for_xml_explicit.asp

Regardless how you get it, once you have the XmlDocument you can transform,
serialize, whatever.

-D
"prefersgolfing" <pr************@hotmail.com> wrote in message
news:Oj**************@TK2MSFTNGP15.phx.gbl...I am creating two services. One downloads XML streams from WebSphere MQ
into a SQL2K database, the other uploads XML Streams into Websphere MQ from
SQL2K. The upload service polls SQL2K every couple of minutes for uploads.
If there are uploads I create an ADO Dataset that I must convert to an XML
stream. The Dataset and the XML stream have different schemas, just to
clarify my dilema. I'm seeking input on the best way to convert ADO
Datasets to XML streams and vice versa, baring in mind their schemas are
different. I did a POC and "hard coded" each field to it's element. Surely,
there's another way. I have several of these to do and most have well over
100 fields. It would be nice to iterate through either the .xsd or the
empty .xml, and fill the .xml, utilizing a .xml based map, with the fields
in the ADO dataset. I am comfortable with the Document and Schema Object
Models. Any recommendations would be welcomed. Thanks in advance for your
time.

Nov 30 '05 #2

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

Similar topics

25
by: David Noble | last post by:
We've been developing a web site using 3-tier architecture for 18 months now. There is a common layer that defines the classes - using XML schemas. The data layer acts as a wrapper to 3 databases...
0
by: Vin | last post by:
Hi, I've got a VB.Net + ASP.Net message board application which has already been customized. There are two solutions in this application. 1. The front end aspx, aspx.vb files, User controls...
4
by: apngss | last post by:
what's the differences between collocated architecture and distributed architecture?? My understanding is that collocated architecture has everything in a single machine? i.e. There is only 1...
2
by: hans | last post by:
Hi! I am new to .NET (coming from Java). We have to implement a desktop application which extracts data from a database, does some analysis, filtering etc. and displays the results. I have...
6
by: Gary James | last post by:
This may not be a direct C# question, but since I'll be using using C# for development, I thought I'd pose the question here. I'll soon be involved in the design of a new software product that...
3
by: RAJESH | last post by:
I am working with c# and asp.net in developing web applications, iam using ..netframework 1.1 ,i want to know what is the need of 3-tier or 4-tier architecture in our application development.what...
1
by: benmorganpowell | last post by:
I have a small windows service which connects to a POP3 server at defined intervals, scans the available messages, extracts the required information and inserts the data into a SQL database. I am...
6
by: carsonbj | last post by:
I have an issue where the below operation works on a little-endian architecture but not on a big-endian architecture. I was under the impression that pointer arithmetic is architecture independant...
13
by: rrs.matrix | last post by:
hi i have to detect the type of CPU. whether it is 32-bit or 64-bit.. how can this be done.. can anyone please help me.. thanks.
0
by: srikar | last post by:
Hi all, I am having a problem, when I am compiling the code in 32 bit option on a 64 bit machine using the macro CPPFLAGS= -m32 I am getting the following warnings from the linker . ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...

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.