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

XML string from data

I want to create an XML string from data. I need to be able to store the
contents of the string in a database. Everything I have seen talks about
xml files... I don't want the IO I just want the data. So in a nutshell,
SQL statement or dataset to fully qualified XML string. And how would I
read that XML string into as dataset to bind to a control later?

Dim DS As DataSet
Dim MyConnection As New SqlConnection
Dim MyCommand As SqlDataAdapter
MyCommand = New SqlDataAdapter(strSQL, SqlCn)
DS = New DataSet("MyCartDS")
MyCommand.Fill(DS, "Cart") ' From here my DS is happy and busting at
the seams with data ..

My thanks in advance,
Joe Johnston
Nov 20 '05 #1
2 1016
Cor
Hi Joe,

Maybe I dont understand you, but XML is not always a dataset, it is a format
that holds and describes data.

In .Net a dataset is always convertable to an XML file using
"dataset.writeXML", but with that not every XML file a dataset.

If you want to import data from an XML file in a database that supports XML
datasets, you have first to make that dataset in the proper dataset XML
format.

You can read XML files (including datasets) in a lot of ways.

By instance using loadXML (the DOM method) or the XMLreader.

I hope this helps a little bit?

Cor
Nov 20 '05 #2
For the lurkers:

The perfect concise answer came from a wonderfull woman in Washington State,
Bonnie Berent:

In order to get the complete XML string, or what would be the contents of
our overpopular .xml files use:
DS.GetXML()

To read an XML string into a DataSet, do something like this:
Dim sr As StringReader = new StringReader(XML
DS.ReadXML(sr, XmlReadMode.InferSchema)

Joe Johnston
www.gotboxer.com

"Joe Johnston" <fu***@cyberjetx.com> wrote in message
news:Od**************@TK2MSFTNGP12.phx.gbl...
I want to create an XML string from data. I need to be able to store the
contents of the string in a database. Everything I have seen talks about
xml files... I don't want the IO I just want the data. So in a nutshell,
SQL statement or dataset to fully qualified XML string. And how would I
read that XML string into as dataset to bind to a control later?

Dim DS As DataSet
Dim MyConnection As New SqlConnection
Dim MyCommand As SqlDataAdapter
MyCommand = New SqlDataAdapter(strSQL, SqlCn)
DS = New DataSet("MyCartDS")
MyCommand.Fill(DS, "Cart") ' From here my DS is happy and busting at
the seams with data ..

My thanks in advance,
Joe Johnston

Nov 20 '05 #3

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

Similar topics

16
by: Khuong Dinh Pham | last post by:
I have the contents of an image of type std::string. How can I make a CxImage object with this type. The parameters to CxImage is: CxImage(byte* data, DWORD size) Thx in advance
0
by: Gaurav | last post by:
Hi, I have a connection string "Data Source=db1.mynet;DATABASE=test;User ID=testuser;Password=test;" , when i use the connection string to get a dataset of all the tables of a database it...
3
by: Justnew | last post by:
Hei All Can some body help me here: I have a database name Customers, I a trying to connect to SQL server through vb.net using asp.net webform. I want to connect to the server programatically...
9
by: rsine | last post by:
I have developed a program that sends a command through the serial port to our business system and then reads from the buffer looking for a number. Everything worked great on my WinXP system, but...
5
by: Divick | last post by:
Hi all, I want to use std::string instead of char * 's as suggested at many places in this newsgroup as well as else where, but I am confused with the way to use it. For example I have a...
29
by: zoltan | last post by:
Hi, The scenario is like this : struct ns_rr { const u_char* rdata; }; The rdata field contains some fields such as :
4
by: JJ | last post by:
I need to encrypt credit card # and store that in a database (and be able to decrypt it). Any codes that use strong encyption algorithm like AES 256 on the web that I can copy and paste? Thanks
3
by: psbasha | last post by:
Hi , When ever we read any data from file ,we read as a single line string ,and we convert the respective field data available in that string based on the data type ( say int,float ). ...
12
by: aparnakakkar2003 | last post by:
can any one tell me if I give the followiing string in input: ABC abc BBC then how I can get ABC abc BBC
3
by: jacob navia | last post by:
Abstract: Continuing the discussion about abstract data types, in this discussion group, a string collection data type is presented, patterned after the collection in C# and similar languages...
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: 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
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...

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.