Click here to Skip to main content
15,898,588 members

Comments by Linux Goblin (Top 8 by date)

Linux Goblin 17-Jan-14 12:00pm View    
Marking your reply as the answer! Thank you ever so much!!! Must have been the case then null != to DBNull
Linux Goblin 17-Jan-14 11:37am View    
With no values in the table it is returning as "Object"
Linux Goblin 17-Jan-14 11:26am View    
Checked what you mentioned, if there is a value in the table it is successfully pulling the value (found what is causing the program to crash) HOWEVER when there is no value in the table scalarVar does return blank but it still registers as a value so it is jumping to the ELSE statement (maybe because it isn't DBNull?)
Linux Goblin 17-Jan-14 10:51am View    
Hi, yes I was using a MySQLException instead so that is why it was crashing (was using it at the time since there was a lot of interaction with DB's). After using the break points, it gets to the IF statement then jumps straight to the else. I have a feeling it is partially due to the SQL query but then again if nothing is in the table then scalarVal should be NULL and then do something else
Linux Goblin 17-Jan-14 9:40am View    
Hi, I've just tried what you've said and changed the code up a bit, I now get the following error: "An unhandled exception of type 'System.ArgumentException' occurred in MySql.Data.dll

Additional information: You have specified an invalid column ordinal."