473,657 Members | 2,505 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Catch Stream as a String

Hi All,

I want to catch a stream as a string.....plea se see below:

Dim stXML As Stream
Dim sReturn as string
dsResult.WriteX ml(stXML)

I want the value of the stream stXML as a string. stXML is a stream.

Thanks in anticipation.
Regards
Rohit
Nov 22 '05 #1
1 1576
Rohit,
Have you considered using a StreamReader to read the Stream?

Something like (untested):
Dim stXML As Stream Dim reader As New StreamReader(st XML) Dim sReturn as string sReturn = reader.ReadToEn d()

Hope this helps
Jay

"Rohit Sharma" <lt************ *@hotmail.com> wrote in message
news:uD******** ******@TK2MSFTN GP09.phx.gbl... Hi All,

I want to catch a stream as a string.....plea se see below:

Dim stXML As Stream
Dim sReturn as string
dsResult.WriteX ml(stXML)

I want the value of the stream stXML as a string. stXML is a stream.

Thanks in anticipation.
Regards
Rohit

Nov 22 '05 #2

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

Similar topics

1
359
by: Rohit Sharma | last post by:
Hi All, I want to catch a stream as a string.....please see below: Dim stXML As Stream Dim sReturn as string dsResult.WriteXml(stXML) I want the value of the stream stXML as a string. stXML is a stream.
0
2025
by: Bryan Olson | last post by:
New and improved! Love Python's stack-tracing error messages, but hate the way GUI applications throw the messages away and crash silently? Here's a module to show Python error messages that would otherwise be lost in console-less programs. Graphical applications should not require console windows, but they do need a workable destination for sys.stderr.
7
14699
by: Alan Paulk | last post by:
It seems to me if you have a function like this public void blah() try { blah blah; } catch
7
5393
by: BC | last post by:
Hi all, I have a method that accepts a string as the parameter. This can be a base64 image string, or just a normal string. Currently to test whether it's a image string or just a normal string, I used try and catch: private void MyMethod(string str){ try{ // If not exception is cought, then it is an image string MemoryStream stream = new MemoryStream(Convert.FromBase64String(str));
5
1500
by: Doug Gifford | last post by:
WROX "Beginning VB.Net" 2nd Edition Using this code from Chapter 11 Page 472: Do Try ' Read a line from the file... currentLine = myReader.ReadLine lineCounter = lineCounter + 1 Catch e As EndOfStreamException ' Display the message...
28
3830
by: RickHodder | last post by:
I'm getting frustrated with using try...catch with local variables: The code below wont compile in .NET 1.1: I get the following error: "Use of unassigned local variable 'oProcessFileReader' " Is there a way around this error? <code> private void Test(string sFileName) {
9
18879
by: Eran.Yasso | last post by:
Hi, My app starts process. Some times this process exits because of exception. Can my app know if the process exited due to exception or gracefully? In both ways, the exit code of this process is zero. I tried using the following, but it goes to catch.
22
3253
by: Amali | last post by:
I'm newdie in c programming. this is my first project in programming. I have to write a program for a airline reservation. this is what i have done yet. but when it runs it shows the number of seats as 0 and the flight no. is also repeating. If any can tell why is this please help me. #include<stdio.h> #include<ctype.h> #include<conio.h>
5
1781
by: mc | last post by:
I have a function (shown below) that I call to check if a server is present. when a server is present, everything is ok. however when it fails. I get an SocketException fired. On my development machine all seems to work and the exception is fired and caught. however on my production server the exception fires, it's not caught by the try catch and it's also not caught in my application_error handler in Global.asax. Can anyone shed any light...
0
8305
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,...
0
8825
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
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,...
0
5632
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
4151
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...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1953
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1611
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.