Re: Type convertsion from string
- From: "Andrus" <kobruleht2@xxxxxx>
- Date: Mon, 15 Oct 2007 21:41:35 +0300
Have you tried Convert.ChangeType?
Jon,
thank you. I changed second line to
p.SetValue(entityTmp, Convert.ChangeType(e.Value, p.PropertyType), null);
and this works.
When user enters letters to numeric cell, this line causes Exception.
How to check that conversion can be performed ?
Should I use try catch to catch this exception or is it possible to
determine conversion error before raising exception ?
Andrus.
.
- Follow-Ups:
- Re: Type convertsion from string
- From: Marc Gravell
- Re: Type convertsion from string
- From: Jon Skeet [C# MVP]
- Re: Type convertsion from string
- References:
- Type convertsion from string
- From: Andrus
- Re: Type convertsion from string
- From: Jon Skeet [C# MVP]
- Type convertsion from string
- Prev by Date: RE: Client connection gets forcibly closed by Server
- Next by Date: Re: Finally which ORM tool?
- Previous by thread: Re: Type convertsion from string
- Next by thread: Re: Type convertsion from string
- Index(es):
Relevant Pages
|