473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

This code hangs my application!

Hi!

A button triggers the code..

I'm trying to learn about the XmlSerializer and when the code comes the try
statement it doesn' throw an exception, it goes into the
MsgBox(string_writer.ToString) and then the application hangs.. I never see
the MessageBox ...

'************************************************* **************************
*****

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim myDataset As DataSet

myDataset = GlobalDataSets._codes

Dim xml_serializer As XmlSerializer

Dim string_writer As New StringWriter

' Create the XmlSerializer.

xml_serializer = New XmlSerializer(GetType(System.Data.DataSet))

' Make the serialization, writing it into the StringWriter.

xml_serializer.Serialize(string_writer, myDataset)

' Display the results.

Try

MsgBox(string_writer.ToString)

Catch ex As Exception

MsgBox(ex.Message)

End Try

End Sub

'************************************************* **************************
******

Pease help/

Lars
Nov 21 '05 #1
3 1502
Can you do a trace and identify the line it hangs on?

"Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
news:Ob*************@TK2MSFTNGP14.phx.gbl:
Hi!

A button triggers the code..

I'm trying to learn about the XmlSerializer and when the code comes the
try
statement it doesn' throw an exception, it goes into the
MsgBox(string_writer.ToString) and then the application hangs.. I never
see
the MessageBox ...
'************************************************* **************************

*****

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim myDataset As DataSet

myDataset = GlobalDataSets._codes

Dim xml_serializer As XmlSerializer

Dim string_writer As New StringWriter

' Create the XmlSerializer.

xml_serializer = New XmlSerializer(GetType(System.Data.DataSet))

' Make the serialization, writing it into the StringWriter.

xml_serializer.Serialize(string_writer, myDataset)

' Display the results.

Try

MsgBox(string_writer.ToString)

Catch ex As Exception

MsgBox(ex.Message)

End Try

End Sub
'************************************************* **************************

******

Pease help/

Lars


Nov 21 '05 #2
Yeah, ... the Line that should display the messagebox.. but I think I know
wht the problem was.. the XML text I was expecting was HUGE... so I think
the messagebox was somehow thoring a fit cause it got to much stuff in the
promt parameter!

/Lars

"scorpion53061" <ad***@nospamherekjmsolutions.com> skrev i meddelandet
news:eQ****************@TK2MSFTNGP14.phx.gbl...
Can you do a trace and identify the line it hangs on?

"Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
news:Ob*************@TK2MSFTNGP14.phx.gbl:
Hi!

A button triggers the code..

I'm trying to learn about the XmlSerializer and when the code comes the
try
statement it doesn' throw an exception, it goes into the
MsgBox(string_writer.ToString) and then the application hangs.. I never
see
the MessageBox ...
'************************************************* **************************
*****

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim myDataset As DataSet

myDataset = GlobalDataSets._codes

Dim xml_serializer As XmlSerializer

Dim string_writer As New StringWriter

' Create the XmlSerializer.

xml_serializer = New XmlSerializer(GetType(System.Data.DataSet))

' Make the serialization, writing it into the StringWriter.

xml_serializer.Serialize(string_writer, myDataset)

' Display the results.

Try

MsgBox(string_writer.ToString)

Catch ex As Exception

MsgBox(ex.Message)

End Try

End Sub
'************************************************* **************************
******

Pease help/

Lars

Nov 21 '05 #3
Simple tip.

Add a System.Diagnostics.TextWriterTraceListner to either your trace
listener or debug listner at startup.

Such as

Trace.Listeners.Add(New System.Diagnostics.TextWriterTraceListener( _

String.Format("C:\LOGS\{0}_{1}.txt", Application.ProductName,
Now().ToFileTime()) _

))

Trace.AutoFlush = True

This way, you don't have to worry about messageboxes and you can just use
Trace.Writeline instead and it automatically gets written to a log file.

There are of course other ways to do this with the app.config, but this is
just a simple approach. and you can sort by filetime.

HTH,

CJ
"Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
news:e2**************@tk2msftngp13.phx.gbl...
Yeah, ... the Line that should display the messagebox.. but I think I know
wht the problem was.. the XML text I was expecting was HUGE... so I think
the messagebox was somehow thoring a fit cause it got to much stuff in the
promt parameter!

/Lars

"scorpion53061" <ad***@nospamherekjmsolutions.com> skrev i meddelandet
news:eQ****************@TK2MSFTNGP14.phx.gbl...
Can you do a trace and identify the line it hangs on?

"Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
news:Ob*************@TK2MSFTNGP14.phx.gbl:
Hi!

A button triggers the code..

I'm trying to learn about the XmlSerializer and when the code comes the try
statement it doesn' throw an exception, it goes into the
MsgBox(string_writer.ToString) and then the application hangs.. I never see
the MessageBox ...

'************************************************* **************************

*****

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim myDataset As DataSet

myDataset = GlobalDataSets._codes

Dim xml_serializer As XmlSerializer

Dim string_writer As New StringWriter

' Create the XmlSerializer.

xml_serializer = New XmlSerializer(GetType(System.Data.DataSet))

' Make the serialization, writing it into the StringWriter.

xml_serializer.Serialize(string_writer, myDataset)

' Display the results.

Try

MsgBox(string_writer.ToString)

Catch ex As Exception

MsgBox(ex.Message)

End Try

End Sub

'************************************************* **************************

******

Pease help/

Lars


Nov 21 '05 #4

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

Similar topics

2
by: Cecil Westerhof | last post by:
We have an application which uses Crystal Reports, FireBird and dynamic views to display reports. When in a short period of time a lot of reports are displayed IIS hangs. Stopping and starting IIS...
3
by: Alex | last post by:
Hi, I am programming asynchronous communication between client and server, with .net asynchronous sockets example from MSDN...
1
by: Thiago Campos Pereira | last post by:
HI, The IDE hangs with 'Initializing offline cache' during attempt to create a Web Application for C# or VB.net. The IDE hangs until it aborts about 1/2 hour later. I'm using Visual Studio 2003....
3
by: Kurt Biesemans | last post by:
Hello, I have a line code : StackTrace stackTrace = new StackTrace(false); When I run the project in debug, the application keeps hanging on this line. My Environment: Windows 2003 Server...
1
by: JQA Academia | last post by:
I've reinstalled twice now... I've got the Visual Studio.net Academic version 2003. During installation, I get no errors but when I try to open a new project from the inital start page, it just...
0
by: roh | last post by:
Hello Friends, We are developing a web based application using DB2 UDB Ver 8.1 FixPack7 and Web Sphere Application Server 6.0. We are facing following issue: When number of users logged into...
0
by: shiggy | last post by:
Hello, I am writing embeded application (actualy web aplication) but i have problem during precompilation There is a front page server that handles http requests and delivers those requests to...
1
by: Mathijs | last post by:
Hi, I have a small Compact Framework tcpclient application (c#). This is my connection procedure: tcpclient = new TcpClient(ip, port); stream = tcpclient.GetStream(); Sent("HELLO");...
0
by: DiverSteveMO | last post by:
Has anyone got HTTPWebRequest and passing a post to an authenticated site to work on a Intel Dual Core Vista Business machine.? We expect approx. 7Kbytes but afer approx. 3K the code then hangs ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.