473,383 Members | 1,853 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,383 software developers and data experts.

format exception was unhandled"

Expand|Select|Wrap|Line Numbers
  1. float[] x = new float[10000];
  2. float[] y = new float[10000];
  3. int c=0;
  4.  
  5. using (StreamReader sr = new StreamReader("e: \\CuPeak.dat"))
  6. {
  7.  
  8. while (!sr.EndOfStream)
  9. {
  10.  
  11. string s = sr.ReadLine();
  12.  
  13. string[] variables = s.Split(' ');
  14. x[c] = float.Parse(variables[0]);//run time ERROR in this line " format exception was unhandled"
  15. y[c] = float.Parse(variables[1]);
  16. Console.WriteLine(x[0]);
  17. }
Nov 15 '09 #1
4 3714
tlhintoq
3,525 Expert 2GB
I know you have been told this before: Please put [code] tags around your code in posts. Stop being lazy and expecting others to do it for you.
Nov 16 '09 #2
tlhintoq
3,525 Expert 2GB
There is no question in your post. What are you asking of the volunteers here?
Nov 16 '09 #3
hi,
There is nothing being lazy, the only thing is that i thought its better to write point 2 point, so i didnt wrote much. but in line no. 14 the question was mentioned. Also, i should have mentioned that at top to highlight it.
sorry to confuse you
Nov 16 '09 #4
cloud255
427 Expert 256MB
Create a break point and step through the code, inspect the value varialbles[0], i'm pretty sure you'll see that it is not a float, this is why you get an error, the value provided cannot be converted into a float.
Nov 16 '09 #5

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

Similar topics

2
by: Chris Herring | last post by:
Hi there: Well, let me start off by saying that I am a Visual Studio drag and drop weenie, not a real programmer. So I tend to get confused when things do not look like the instructions said they...
6
by: Paul Steele | last post by:
I often use the following code to check if a program is already running: if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length > 1) ... This works find on all of my...
5
by: Peter Steele | last post by:
We have an application that when it runs in the IDE in debug mode an unhandled exception is occurring in a system header file associated with STL stirngs. The actual statement that crashes is ...
1
by: John Chorlton | last post by:
I've been attempting to pass a chunk of data back from a child Windows form using public properties on the form and have been getting some odd errors. I wanted to return a row of data to avoid...
3
by: dan | last post by:
I am using VB.NET 2003 and SQL Server 2000. The program uses ADO.NET . The following instruction: Me.cd_insertDataRecord.ExecuteNonQuery() throws this exception: ">>>ProcessDataRecord/...
1
by: Samuel R. Neff | last post by:
Occasionally we get this error message when running an app on a test machine: .exe - Common Language Runtime Debugging Services Application has generated an exception that could not be...
2
by: whiskers | last post by:
I'm debugging some code and I have to admit that I don't know yet how it works. But I ran into a problem I can't explain The program is a DLL that retrieves raw data from a camera, builds...
0
by: Tamer Ibrahim | last post by:
Hi, Sometimes, I got the following error message when I use ajax calendar control on some aspx pages : Object reference not set to an instance of an object. Description: An unhandled exception...
0
by: Gary | last post by:
Trying to install VB6 (learning edition) on Windows XP. When running the SETUP.EXE to install Visual Basic 6.0 it gives the error... "An unhandled win32 exception occured in vs60wiz.exe" or...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.