473,714 Members | 2,481 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataSet & XML format


Hello, gurus
I have a problem about format XML
I use ms data access building block to get a data set from stored
procedure. the dataset's save xml give me data with the elements.
Is there any better way to format what I want ,says some attributes &
some elements ?? Is it easy ?? or I must using string.format each
datarow in the dataset to construct the xml or via xslt to transform ??
any idea ??

Regards,
.Net Newbie
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #1
10 3314
hi
Query ur database to retrieve only the req things
i guess u r not manipulating bulk data so the better option is to go for
xmldatareader rater than dataset
Use XPath rather than using XMLDocument

ur posting confused me with the xslt stuff!
coz r u needing the output as XML or just some data???
if u need it a s element (ie values) then go for the above method

Never use String.Format on each datarow it is (sorry to use the word)
rubbish

Go thru msdn.microsoft. com/xml also

Cheers


".Net_Newbi e" <somewhere@some place> wrote in message
news:u8******** ******@TK2MSFTN GP12.phx.gbl...

Hello, gurus
I have a problem about format XML
I use ms data access building block to get a data set from stored
procedure. the dataset's save xml give me data with the elements.
Is there any better way to format what I want ,says some attributes &
some elements ?? Is it easy ?? or I must using string.format each
datarow in the dataset to construct the xml or via xslt to transform ??
any idea ??

Regards,
Net Newbie
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #2


Sir,
thanks for your help soon.
My goal is let the data in the database represent as an XML document
so that others can use my data via HTTP request, the data (xml) format
is deccided by others ( element or attribute ). What I care is maybe the
XML format ( element or attribute ) will change by different consumers
?? so I hope to do that via xslt at first?!. As ur suggestions, just use
xmldatareader not dataset.

Besides, how about sql server for xml syntax ??

Regards

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3
in the other post i did'nt get ur requirement
i thought u wanna get the value out of some element or attribute.in that
case the xmlreader is the best option u can go for.

I did'nt get waht u meant by "format changed by consumers".R u providing the
XML feed as a webservice?
* if u want to preserve the format go for xml schema
* if ur data is only less then use XMLReader and related stuff.
* Use XPath to iterate thru the nodes

if this is not the thing u r looking for can u plz specify ur requiremnt .it
is not clear in ur previous posting
ie what r u planing to do with XML output?
r u providing a web service?etc

Reg





".Net_Newbi e" <somewhere@some place> wrote in message
news:Oy******** ******@TK2MSFTN GP09.phx.gbl...


Sir,
thanks for your help soon.
My goal is let the data in the database represent as an XML document
so that others can use my data via HTTP request, the data (xml) format
is deccided by others ( element or attribute ). What I care is maybe the
XML format ( element or attribute ) will change by different consumers
?? so I hope to do that via xslt at first?!. As ur suggestions, just use
xmldatareader not dataset.

Besides, how about sql server for xml syntax ??

Regards

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #4
Sir,

sorry not clear my requirement. u r right,

actually I'm doing like web service ( but just internal use, xml data
will used by web page or windows appz via http request)

all the data format requirement are different, I think if I keep the
schema in the xml, all thing will be good, right ??
but the requirement ( xml layout requirement is assigned
by the appz side :( too bad ......)
I don't want to rewrite my program to feed new requirement

Any idea ??

Regards,
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #5

yep i got it at last!!!!!

if the fields are wanted as per request also it will have a
neame right?
then u will know the name of all the nodes in your (xml)since u r feeding
xml from database so then what is the problem ?
u know the name of the node and u know the function that node should do
(somnthing like say populating a tree control fot the node named <head>)

or if u wanto to feed the data according to Role based security what follow
the same stuff
keep configuraton for each role ( i mean which node to whom all) then
populate accordingly. this sort of customizations are simple right?

so write code accordingly.All the best
Hope this Helps

Regards
An Indian :)-

".Net_Newbi e" <somewhere@some place> wrote in message
news:#l******** ******@tk2msftn gp13.phx.gbl...
Sir,

sorry not clear my requirement. u r right,

actually I'm doing like web service ( but just internal use, xml data
will used by web page or windows appz via http request)

all the data format requirement are different, I think if I keep the
schema in the xml, all thing will be good, right ??
but the requirement ( xml layout requirement is assigned
by the appz side :( too bad ......)
I don't want to rewrite my program to feed new requirement

Any idea ??

Regards,
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #6
sir,

so just use String.Format to construct the xml ??
or via xmlreader or from server side ( for xml auto | explicit ) option
??
advantages/disadvantages ??

Appreciate for your help !
Regards
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #7
sir,

so just use String.Format to construct the xml ??
or via xmlreader or from server side ( for xml auto | explicit ) option
??
advantages/disadvantages ??

Appreciate for your help !
Regards
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #8
i use to do with String when there is only less data
else i use
xmlreader and XPath...
coz it is more manageble eventhough string can grow upto 2gb
Regards

".Net_Newbi e" <somewhere@some place> wrote in message
news:OZ******** *****@TK2MSFTNG P12.phx.gbl...
sir,

so just use String.Format to construct the xml ??
or via xmlreader or from server side ( for xml auto | explicit ) option
??
advantages/disadvantages ??

Appreciate for your help !
Regards
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #9
Sir ,
Thanks for ur reply soon again.
Here is an xml data what I want,
ex.
My DB return a result set by my stored procedure about Dept. & Employee
information ( join from 2 table )

DEPTID LOATION EMPID EMPNAME AGE
--------------------------------
10 LA 101 Peter 30
10 LA 102 Joe 20
20 BOSTON 103 Jean 24
30 NY 104 Tom 28

My desired xml like follows:
<DeptAndEmploye e>
<Dept id='10' Loc='LA'>
<Emp eid='101' Name='Peter' Age='30' />
<Emp eid='102' Name='Joe' Age='20' />
</Dept>
<Dept id='20' Loc='BOSTON'>
<Emp eid='103' Name='Jean' Age='24' />
</Dept>
<Dept id='30' Loc='NY'>
<Emp eid='104' Name='Tom' Age='28' />
</Dept>
</DeptAndEmployee >

Any easy & efficient way to format like this ??
how about use dataset then go trou the ds to format ??

any idea ?? via string.Format or xmlreader ?? or other good method

Thanks a lot !
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #10

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

Similar topics

0
1137
by: JMorrell | last post by:
I have a dataset with a date field. The date format for the underlying SQL server table is smalldatetime. When I bind the form's field to the dataset column, it comes out as longdate (date with hours:minutes:seconds AM/PM). I want the format to be MM/dd/yy. Dim dt As New DataTable() Dim dr As DataRow dt = dataset.Tables(0) For Each dr In dt.Rows
0
1269
by: mh1mark | last post by:
I have a rpt from an ADO.NET dataset that has been created in code. I created a dummy dataset in Visual studio using the designer. It has EXACTLY the same format as the one created in the program. I checked the data in the dataset before it calls the report and the data is there. HOWEVER: When I add fields to the report and run it, the first field on the dataset is coming up blank on the rpt, even though it has data in it when it calls...
1
8121
by: Shaileen Patel | last post by:
Hi, I am trying to convert a lot of web reports from ASP/VB to ASP.NET/VB.NET. I would like to save my dataset in XML and then use XSLT to transform the XML. The catch is I would like to have the XML in the format that ADO uses versus the default format in which ADO.NET uses. Currently, I am using ADO within .NET, but I am concerned about the performance and it might improve if I used the native data providers for .NET. I am not sure if...
4
10034
by: suzy | last post by:
hello. how can i sort data in a dataset? all the examples i have seen on msdn, etc are sorting a dataview. this works fine, but i want to return the results in xml and the dataview doesn't have a .getxml method (unlike the dataset). any ideas? thanks.
0
387
by: Kathryn | last post by:
Hello, I am trying to read an xml file into a web page via asp.net. I am current using an rss format and reading it directly into a DataSet with the following command: ds.ReadXml("xmlfilepath\xmlfile.xml", XmlReadMode.Auto) Here is an example of an element in the xml file: <item> <title>Newark Valley Fathers Day Challenge</title>
10
4025
by: andrewcw | last post by:
I read in a earlier post that I can get the column of a grid to sort by datetime if the column type was set as Date I deserialize my XML and one attribute of the XSD has type as dateTime but upon inspection and behavior in the gri the data type is string. If I preview the dataset with the GUI in VISSTUDIO it shows my datatype to be dateTime .. If I try to rest the datatype I get this erro Additional information: Cannot change DataType...
3
8040
by: jayuya | last post by:
Can anyone give a sample code, tip, or a web link with an example of how to format data to currency. eg: $3451.25 I set a dataadapter and I fill the dataset from a SQL Statement, but some fields are a double data type and I need to display those fields to the user in currency format... I am using ASP.NET/VB.NET/ADO.NET
13
2366
by: Maxwell2006 | last post by:
Hi, We are having a debate over using DataSet as return value type for web services. The problem is that we don't know whether Java applications can use DataSet
15
13510
by: Joseph Geretz | last post by:
I'm a bit puzzled by the current recommendation not to send Datasets or Datatables between application tiers. http://support.microsoft.com/kb/306134 http://msdn2.microsoft.com/en-us/library/ms996381.aspx Formerly, with classic Microsoft DNA architecture, the ADO Recordset was a primary transport medium, recommended for transmitting data between application tiers. In fact, there are whole books written on the subject.
0
8704
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
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...
0
7946
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
6627
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
5943
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
4462
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...
1
3155
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
2
2514
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2105
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.