Discussion:
storing xml data into a sybase db
(too old to reply)
Nitin
2006-08-05 21:01:02 UTC
Permalink
Hi,

I am a newbie here, but seem to facing an apparently difficult task.

I have a Sybase database and would like to do two things:
1. Take data from an XML file and put it in the db tables
2. Take data from the db and put it in a XML file according to a XSD schema
structure.

My application is in C#. I have been reading a lot about SQLXML and XPATH,
but dont quite understand how I would use it. The examples on MSDN are about
SQL Server. Would an annotated XML Schema help any.

Any ideas would be great. Thanks in advance.

Nitin
e
2006-08-06 01:14:48 UTC
Permalink
Well i don't know about sysbase XML implementation, but it it could convert
string (varchar or nvarchar) into xml that would be great.
But first checkout Ase ADO.net provider if there's such implemenation as
SqlXml wihich takes XmlReader. if not then you'll have to resort to the
XMlString which could obtained from XmlDocument.OuterElement

//
// 1st option
SqlXml sqlx = new SqlXml(XmlReader.Creat("test.xml"))


// 2nd
XmlDocument doc = new XmlDocument();
doc.Load("test.xml");
string xml = doc.OuterXml
// then use the value to insert to the database

// validate it against XmlValidatingReader

you could do the samething for the retrived
Post by Nitin
Hi,
I am a newbie here, but seem to facing an apparently difficult task.
1. Take data from an XML file and put it in the db tables
2. Take data from the db and put it in a XML file according to a XSD schema
structure.
My application is in C#. I have been reading a lot about SQLXML and XPATH,
but dont quite understand how I would use it. The examples on MSDN are about
SQL Server. Would an annotated XML Schema help any.
Any ideas would be great. Thanks in advance.
Nitin
Martin Honnen
2006-08-06 12:13:31 UTC
Permalink
Post by Nitin
1. Take data from an XML file and put it in the db tables
2. Take data from the db and put it in a XML file according to a XSD schema
structure.
My application is in C#. I have been reading a lot about SQLXML and XPATH,
but dont quite understand how I would use it. The examples on MSDN are about
SQL Server. Would an annotated XML Schema help any.
This group is (mainly) about XML with the COM based MSXML. For XML and
.NET there is microsoft.public.dotnet.xml, for SQL server and XML there
is microsoft.public.sqlserver.xml.
None of them are ideal places to ask about Sybase I think, it seems
better to first ask in a newsgroup or forum dedicated to that data base
system and asking about XML export and import possibilities.

In terms of .NET one way to establish a relation between relational data
and XML is System.Data.DataSet with its method ReadXml, ReadXmlSchema,
WriteXml, WriteXmlSchema, InferXmlSchema. Thus if you can use e.g.
System.Data.OleDb, the .NET framework data provider for OLE DB, with
Sybase, then you have a way to query the data base and get a DataSet and
use those methods.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Loading...