MySQL Forums
Forum List  »  MySQL Query Browser

Re: Column can not be null
Posted by: Guy Shen
Date: January 12, 2010 06:39PM

OK, Chad. I hope you're still with me, because i have another problem, having this one solved.
In Query browser, i created the function in such fashion that it will recieve three arguments, and insert them into the table, and everything is working great.

The only thing that still bugs me, is the last piece of code.
When the insertion is done, the function returns the value 1 (as int).

So, i've used this code to get the "1" :
MySqlDataReader DR;
mycon.Open();
DR = mySqlCommand.ExecuteReader();
DR.Read();
Label4.Text = DR.GetInt32(0).ToString();

Thing is that i get an error message telling me the following:
"Invalid attempt to read from column ordinal" and he checks the last line of code as the problematic one. Any ideas ? Thanks ahead.

P.S assuming that I wanted to work with ExecuteScalar(), how could that be done?



Edited 1 time(s). Last edit at 01/12/2010 06:47PM by Guy Shen.

Options: ReplyQuote


Subject
Written By
Posted
January 11, 2010 04:37PM
January 11, 2010 07:53PM
January 12, 2010 03:07AM
January 12, 2010 09:03AM
January 12, 2010 05:22PM
Re: Column can not be null
January 12, 2010 06:39PM
January 13, 2010 05:44PM
January 14, 2010 09:44AM
January 14, 2010 06:28PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.