jayceepoo Posted March 17, 2005 Posted March 17, 2005 I have a variable declared as a char that is going to hold a value in a table (for which the column is char(1)). I populate a dataSet with that table, and I try to assign the value to the variable as: cCriteriaTypeAbbrev = DirectCast(tblDetail.Rows(j).Item("CriteriaTypeAbbreviation"), Char)But I get an invalid cast exception. I stepped through the code, and in the command window, i typed ? tblDetail.Rows(j).Item("CriteriaTypeAbbreviation"), and the command window said that it was a string variable? Does anyone know why this is? Thx for your time... Quote
Moderators Robby Posted March 18, 2005 Moderators Posted March 18, 2005 If you were to use a Strongly-typed dataset then your table would realize that it was of type Char, but in this case it will always be a String. Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.