Wednesday, March 21, 2012

OLEDB XML Reader

I need to read XML from an XML query using OLEDB reader. Is it possible?

I found code to load the XML from a data set. I tried the following code but the XML file was incorrect.

DataSet dsXML = new DataSet();

OleDbDataAdapter DBAdapter = new OleDbDataAdapter();

OleDbCommand command = new OleDbCommand();

XMLDataDocument xmlData;

command.Connection = conn;

command.CommandType = CommandType.StoredProcedure;

command.CommandText = "usp_GetXML"

DBAdapter.SelectCommand = command;

DBAdapter.Fill(dsXML, "XMLData");

xmlData = new XmlDataDocument(dsXML);

The XML file looked like:

<NewDataSet>
<XMLData>
<XML_F52E2B61-18A1-11d1-B105-00805F49916B> ... lots of letters ...</XML_F52E2B61-18A1-11d1-B105-00805F49916B>
</XMLData>
</NewDataSet>

XML_F52E2B61-18A1-11d1-B105-00805F49916B is the name of the column of the XML generated in the SQL server.

anybody know what I am doing wrong?

Thanks in advance.

|||Hello

I am an asp.net developer.I have facing some problem for reading an XML from a given link. i have try it for another link it is ok. but the link which have authentication to open is not read into dataset.
i have put code like below

dim ds as new dataset
ds.readxml(link as string)

i have put the authenticated link directly to the browser. it the prompted for user name and password. there when i give the uname and pwd it is open.

but how can i authenticate the XML at the time of read xml in dataset in asp.net through coding.
Can any body know the process? then please help me. and send details code and procedure

waiting for kind reply

suk

No comments:

Post a Comment