473,671 Members | 2,484 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamically loading raw XML from SQL2K into an XML doc (ASP to C#)

In ASP, I have something like this:

Set conn = Server.CreateOb ject("ADODB.Con nection")
Set cmd = Server.CreateOb ject("ADODB.Com mand")
Set adoStream = Server.CreateOb ject("ADODB.Str eam")
conn.Open strConnString
Set cmd.ActiveConne ction = conn
cmd.CommandText = strSQL
adoStream.Open
cmd.Properties( "Output Stream").Value = adoStream
cmd.Properties( "xml root") = "XMLRoot"
cmd.Execute , , adExecuteStream
adoStream.Posit ion = 0
xmlDoc.loadXML adoStream.ReadT ext()

In C#, I have this so far:

System.Data.Ole Db.OleDbConnect ion objCN = new
System.Data.Ole Db.OleDbConnect ion();
objCN.Connectio nString = ConnString;
objCN.Open();
System.Data.Ole Db.OleDbCommand objCmd = new
System.Data.Ole Db.OleDbCommand ();
objCmd.Connecti on = objCN;
objCmd.CommandT ype = CommandType.Tex t;
objCmd.CommandT ext = strSQL;
System.Data.Ole Db.OleDbDataRea der objDR = objCmd.ExecuteR eader();

System.Xml.XmlD ocument xmlDom = new System.Xml.XmlD ocument();
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...
Nov 15 '05 #1
1 2939
Can anyone help me out - I'm really in a jam here.. :o(

"Frank Drebin" <no*****@imsick ofspam.com> wrote in message
news:VI******** **************@ newssvr28.news. prodigy.com...
In ASP, I have something like this:

Set conn = Server.CreateOb ject("ADODB.Con nection")
Set cmd = Server.CreateOb ject("ADODB.Com mand")
Set adoStream = Server.CreateOb ject("ADODB.Str eam")
conn.Open strConnString
Set cmd.ActiveConne ction = conn
cmd.CommandText = strSQL
adoStream.Open
cmd.Properties( "Output Stream").Value = adoStream
cmd.Properties( "xml root") = "XMLRoot"
cmd.Execute , , adExecuteStream
adoStream.Posit ion = 0
xmlDoc.loadXML adoStream.ReadT ext()

In C#, I have this so far:

System.Data.Ole Db.OleDbConnect ion objCN = new
System.Data.Ole Db.OleDbConnect ion();
objCN.Connectio nString = ConnString;
objCN.Open();
System.Data.Ole Db.OleDbCommand objCmd = new
System.Data.Ole Db.OleDbCommand ();
objCmd.Connecti on = objCN;
objCmd.CommandT ype = CommandType.Tex t;
objCmd.CommandT ext = strSQL;
System.Data.Ole Db.OleDbDataRea der objDR = objCmd.ExecuteR eader();

System.Xml.XmlD ocument xmlDom = new System.Xml.XmlD ocument();
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...

Nov 15 '05 #2

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

Similar topics

0
2106
by: John Crowley | last post by:
I'm having an odd problem with viewstate and a dynamically created control inside a repeater template. Basically, I have a repeater setup like this in the aspx:
1
3016
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am have facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My requirement is to load the web user controls on the web page dynamically. To do this, First I including a web page (MainPage.aspx) and I made form tag to Runat=Server. I included one table tag and also made this table Runat=Server side. Second I created three Web User Controls e.g....
1
1420
by: kanones | last post by:
Hi - I am seeing some performance degradation when I am loading a control dynamically onto a page with multiple other dynamical controls using Page.LoadControl versus dragging and dropping it onto an individual page. Page1.aspx.cs UserControl uc = Page.LoadControl("../UserControls/UserControl1.ascx") Page2.aspx
6
3370
by: Steve Booth | last post by:
I have a web form with a button and a placeholder, the button adds a user control to the placeholder (and removes any existing controls). The user control contains a single button. I have done all the usual stuff of recreating the usercontrol in the Page Init event. The 'failure' sequence is as follows: - select web form button to display the user control - select user control button, event fires - select web form button to display...
1
2056
by: Jeffrey Todd | last post by:
I have successfully created functionality that mostly models what I'm trying to do - which is dynamically insert controls into a user control (ascx), and insert validation controls, also dynamically, for some of the inserted controls. The controls (e.g., textBoxes) get created correctly and viewstate is maintained across postbacks, etc - BUT there is an issue with the validation controls. The validation controls, themselves are...
7
3187
by: Samuel | last post by:
Hi, I am building a page that makes use of user control as a templating technique. The following is that I have in mind and it is actually working: Root/ -- login.aspx -- login.aspx.vb -- UC/ ----- Classic/
3
2536
by: Dotnet Gruven | last post by:
I've built a WebForm with a Table added dynamically in Page_Load when IsPostBack is false. The table includes a couple of TextBoxes, RadioButtonLists and CheckboxLists. On postback, those controls are not present nor their valves in Request.Form.AllKeys.
3
1184
by: supvine | last post by:
Hello, I am developing a page that has several custom web user controls that need to be loaded dynamically. Some of the controls are loaded based on the action (button-click) of a different control in the parent page. Currently what I have to do to make this work is set a session variable to load/unload a particular control and do a Server.Transfer to the page itself from the Button_Click event. Is this a good way of loading controls...
1
1834
by: Bob Rock | last post by:
Hello, I'm new to ASP.NET and I've been looking into the topic of dynamically loading (typically accomplished with a LoadControl followed by a MyControl.Controls.Add()) both user controls and asp.net web controls. I searched for articles on the internet and in the end I must say that I'm confused. I read about issues related to: a.. events not firing
0
8483
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8401
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,...
1
8603
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6236
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
5703
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
4227
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...
0
4416
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2060
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1815
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.