I have a comboboxedit control that has a requery event taking three integer parameters. The FillDataTable method in the BO looks like this:
public
This actually works (thanks for the help earlier this week!). The problem comes in when the combobox hits one of the resulting columns. It is the "orderid" field. It gets to the following code:[Browsable(false),BusinessFieldDisplayInEditor(),Description(""),DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]public System.Int32 orderid{ get { return (System.Int32)this.CurrentRow["orderid"]; <--*** OFFENDING CODE *** } set { this.CurrentRow["orderid"] = value; }}
The get_orderid() method kicks out a "Specified cast is not valid" error. If I place the parameters into the SQL Query Analyzer, I get a result set that does have an orderid and it is an integer value.
Any ideas about what I should do or where to look for a solution?Thanks!!Bill
I would have to set this up on an SQL Server 2000 machine...but it was actually SQL Server passing it over as long...not the BO converting the value. It has been a while since I lived in SQL Server 2000 as we only use 2005 (and soon 2008) any more in the field. However, if I am not mistaken, I think that when a field was derived in SQL Server 2000 and it was not explicity defined in a variable or from an underlying field table, it always went the the larger of the values...in this case LONG (BIGINT) over INT. I would have to get my head back into the older rules...but at any rate, I am glad you got it figured out.
Now you have my curiosity up...I will have to load a 2000 machine up and give it a go