473,405 Members | 2,338 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,405 software developers and data experts.

Threading

366 256MB
Hello

i am working with C#2005 where my requirement is to send and receive data through serial port.i have succeded in that part ,but my second task is to splict the received data and insert into data base where exactly i am facing this problem

Expand|Select|Wrap|Line Numbers
  1. ///my code for received data
  2.  
  3. private void port_DataReceived(object sender, SerialDataReceivedEventArgs e)
  4.  
  5. {// Event for receiving data
  6.  
  7. // Read the buffer to text box.
  8.  
  9. this.Invoke(new EventHandler(DoUpdate));
  10.  
  11. }
  12.  
  13. private void DoUpdate(object s, EventArgs e)
  14.  
  15. {
  16.  
  17. statusBar1.Text = "Getting Data";
  18.  
  19. statusBar1.Refresh();
  20.  
  21. RichtextBox1.Text = RichtextBox1.Text + port.ReadExisting();
  22.  
  23. string s=port.ReadExisting();
  24.  
  25. if(s.Length>60)
  26. {
  27.  
  28. //my code for other validations go here
  29. // i will call here the split method
  30.  
  31. Split();
  32.  
  33. // inthis split method i am inserting data in to database
  34. }
  35. }
in the code i posted ,the code in the Split(); is only getting executed when ever i place a break point there with out break poing my application is running fine but that split method is not getting executed .

i tried for this alot in google but no use i am unable find the actual problem

can any one there with some suggestion

i am not getting any exception or any error other then that method is skipped when there is no break point

Regards

NMsreddi
Feb 27 '07 #1
4 812
kenobewan
4,871 Expert 4TB
Here is an article that may help:
String.Split
Feb 27 '07 #2
nmsreddi
366 256MB
Hello

My problem is not in splitting the data ,my method works well for that

the method by name split is not executing unless i keep a break poin t

there i think i have to attach any process for that

i hope my problem is clear now

any suggestion please......

Regards

NMsreddy
Feb 28 '07 #3
kenobewan
4,871 Expert 4TB
Have you written the value of s.length to see whether it is > 60?
Feb 28 '07 #4
nmsreddi
366 256MB
hello

Yes i am taking the the length of string s .

length of string s may vary from 5 to 150 but i want to consider messages of

length that greater than 60 characters only

i am able to get in to that loop when i keep a break point at that loop

if i remove that break point the loop is never getting executed

Hope the problem is clear

Regards
NMsreddy
Feb 28 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

65
by: Anthony_Barker | last post by:
I have been reading a book about the evolution of the Basic programming language. The author states that Basic - particularly Microsoft's version is full of compromises which crept in along the...
2
by: Egor Bolonev | last post by:
hi all my program terminates with error i dont know why it tells 'TypeError: run() takes exactly 1 argument (10 given)' =program==================== import os, os.path, threading, sys def...
77
by: Jon Skeet [C# MVP] | last post by:
Please excuse the cross-post - I'm pretty sure I've had interest in the article on all the groups this is posted to. I've finally managed to finish my article on multi-threading - at least for...
6
by: CK | last post by:
I have the following code in a windows service, when I start the windows service process1 and process2 work fine , but final process (3) doesnt get called. i stop and restart the windows service...
2
by: Vjay77 | last post by:
In this code: Private Sub downloadBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) If Not (Me.downloadUrlTextBox.Text = "") Then Me.outputGroupBox.Enabled = True...
11
by: Paul Sijben | last post by:
I am stumped by the following problem. I have a large multi-threaded server accepting communications on one UDP port (chosen for its supposed speed). I have been profiling the code and found...
17
by: OlafMeding | last post by:
Below are 2 files that isolate the problem. Note, both programs hang (stop responding) with hyper-threading turned on (a BIOS setting), but work as expected with hyper-threading turned off. ...
0
by: kingcrowbar.list | last post by:
Hello Everyone I have been playing a little with pyGTK and threading to come up with simple alert dialog which plays a sound in the background. The need for threading came when in the first...
7
by: Mike P | last post by:
I am trying to write my first program using threading..basically I am moving messages from an Outlook inbox and want to show the user where the process is up to without having to wait until it has...
126
by: Dann Corbit | last post by:
Rather than create a new way of doing things: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2497.html why not just pick up ACE into the existing standard:...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
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...

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.