F
Fred Dag
Hi,
I have a table adapter created using the DataSet gui in VS2005. The code it
generates returns this error:
System.InvalidCastException: Unable to cast object of type 'System.DBNull'
to type 'System.String'.
Line 3224: get {
Line 3225: try {
Line 3226: return
((string)(this[this.tableITEM.DescriptionColumn]));
Line 3227: }
Line 3228: catch (System.InvalidCastException e) {The my code
looks like this:items =
itemAdapter.GetREFItemDataByItemNumber(rEFItemNumber);string description;if
(Convert.IsDBNull(items[0].Description)){description = "";}else{description
= items[0].Description;}As far as I can tell the error is in the code
generated by the table adapter and not my code. How do I solve this
problem?Thanks in advance.
I have a table adapter created using the DataSet gui in VS2005. The code it
generates returns this error:
System.InvalidCastException: Unable to cast object of type 'System.DBNull'
to type 'System.String'.
Line 3224: get {
Line 3225: try {
Line 3226: return
((string)(this[this.tableITEM.DescriptionColumn]));
Line 3227: }
Line 3228: catch (System.InvalidCastException e) {The my code
looks like this:items =
itemAdapter.GetREFItemDataByItemNumber(rEFItemNumber);string description;if
(Convert.IsDBNull(items[0].Description)){description = "";}else{description
= items[0].Description;}As far as I can tell the error is in the code
generated by the table adapter and not my code. How do I solve this
problem?Thanks in advance.