BreasiaNakFek
New Member
I'm about to break out the sledgehammer here guys. This just doesn't seem right in any fashion. I'm retrieving some values from a database. I need to assign them to some form fields, and thus they need to be of type string. So I go about my merry way and do the following:<BR><BR>txtExpireDays.Value = http://aspmessageboard.com/archive/index.php/(string) results["adExpire"]<BR><BR>and it's kind enough to throw the error:<BR>Exception of type System.InvalidCastException was thrown. <BR><BR>adExpire is a database field of type int, with a value of 30. There should be no reason that I can think of why this won't convert. Without the conversion, the compiler throws the error:<BR><BR>Cannot implicitly convert type 'object' to 'string'<BR><BR>Anyone have an answer?