F
Frank Drebin
In ASP, I have something like this:
Set conn = Server.CreateObject("ADODB.Connection")
Set cmd = Server.CreateObject("ADODB.Command")
Set adoStream = Server.CreateObject("ADODB.Stream")
conn.Open strConnString
Set cmd.ActiveConnection = conn
cmd.CommandText = strSQL
adoStream.Open
cmd.Properties("Output Stream").Value = adoStream
cmd.Properties("xml root") = "XMLRoot"
cmd.Execute , , adExecuteStream
adoStream.Position = 0
xmlDoc.loadXML adoStream.ReadText()
In C#, I have this so far:
System.Data.OleDb.OleDbConnection objCN = new
System.Data.OleDb.OleDbConnection();
objCN.ConnectionString = ConnString;
objCN.Open();
System.Data.OleDb.OleDbCommand objCmd = new
System.Data.OleDb.OleDbCommand();
objCmd.Connection = objCN;
objCmd.CommandType = CommandType.Text;
objCmd.CommandText = strSQL;
System.Data.OleDb.OleDbDataReader objDR = objCmd.ExecuteReader();
System.Xml.XmlDocument xmlDom = new System.Xml.XmlDocument();
xmlDom.Load(<I need that data reader in some loadable format here>);
Just a regular connection and returning a datareader - but to create an XML
doc, it needs an XmlReader - which DataReader isn't compatible. How can I
take the raw stream from OleDb and load that right into an XML doc?
Any ideas? Thanks in advance...
Set conn = Server.CreateObject("ADODB.Connection")
Set cmd = Server.CreateObject("ADODB.Command")
Set adoStream = Server.CreateObject("ADODB.Stream")
conn.Open strConnString
Set cmd.ActiveConnection = conn
cmd.CommandText = strSQL
adoStream.Open
cmd.Properties("Output Stream").Value = adoStream
cmd.Properties("xml root") = "XMLRoot"
cmd.Execute , , adExecuteStream
adoStream.Position = 0
xmlDoc.loadXML adoStream.ReadText()
In C#, I have this so far:
System.Data.OleDb.OleDbConnection objCN = new
System.Data.OleDb.OleDbConnection();
objCN.ConnectionString = ConnString;
objCN.Open();
System.Data.OleDb.OleDbCommand objCmd = new
System.Data.OleDb.OleDbCommand();
objCmd.Connection = objCN;
objCmd.CommandType = CommandType.Text;
objCmd.CommandText = strSQL;
System.Data.OleDb.OleDbDataReader objDR = objCmd.ExecuteReader();
System.Xml.XmlDocument xmlDom = new System.Xml.XmlDocument();
xmlDom.Load(<I need that data reader in some loadable format here>);
Just a regular connection and returning a datareader - but to create an XML
doc, it needs an XmlReader - which DataReader isn't compatible. How can I
take the raw stream from OleDb and load that right into an XML doc?
Any ideas? Thanks in advance...