Jay, that did it. I was able to use the Convert expression with both Char,
String, and Decimal. I also need to convert to Guid but I haven't tried that
one yet. If I can't, I can always use the string representation of the guid.
Thanks so much, this has been kicking my tale. I really appreciate you guys
responding and so quickly.
"Jay" wrote:
Try
IsTaxable =
Convert.ToChar(dsTaxData.Tables["ShipTo"].Rows[0]["is_taxable"]);
or
IsTaxable = dsTaxData.Tables["ShipTo"].Rows[0]["is_taxable"].ToString()[0];
"Johnny" <Jo****@discussions.microsoft.com> escreveu na mensagem
news:22**********************************@microsof t.com... Gav, I get an error message that states "Cannot convert type string to
type
char when I try this. Also, I have other variables with datatypes of
decimal, Guid, etc. that I will need to assign and I believe this would
only
work for string type variables.
"Gav" wrote:
Try:
IsTaxable =
(char)dsTaxData.Tables["ShipTo"].Rows[0]["is_taxable"].ToString();
"Johnny" <Jo****@discussions.microsoft.com> wrote in message
news:02**********************************@microsof t.com...
> How do I assign a value in a dataset to a variable. I have the
> following
> code that's giving me an error message:
>
> char IsTaxable;
> IsTaxable = dsTaxData.Tables["ShipTo"].Rows[0]["is_taxable"];
>
> The is_taxable datatype is string and the error message that I'm
> receiving
> is "Cannot implicitly convert type 'object' to 'char'.
>
> I'm a rookie and not sure how to assign the value of my variable. Any
help
> would be appreciated as I have 5 result sets that with several columns
that I
> need to assign to variables in my business objects.