dseaver
IS-IT--Management
- Jul 13, 2006
- 467
I found when I was working on an API for a SQL db at work that I would get exceptions using a cast with Scalar type Query. I used Convert.ToInt32 instead, which solved the problem, but this is not my question.
My question is what is better practice, using a cast or using Convert.To____ to get an object into the correct type? Ever since I ran into that problem with the query, I find myself using Convert
My question is what is better practice, using a cast or using Convert.To____ to get an object into the correct type? Ever since I ran into that problem with the query, I find myself using Convert