Unable to cast object of type 'System.DBNull' to type 'System.String'.


Unable to cast object of type 'System.DBNull' to type 'System.String'....
Author
Message
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Good you got it!

Wink

Luiz Carneiro Lima
Luiz Carneiro Lima
StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)
Group: Forum Members
Posts: 25, Visits: 87
The value was decimal… therefore was giving problem of cast.

I corrected the problem.

Thanks!!

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
If you put a breakpoint on the line where it fails, add the loValue.GetType() to the watch window to see what the type actually is.  It is indicating that the type cannot be casted, so we need to know what is in loValue.  I know the display value is "1" but I would like to know what the GetType() method indicates the data type as.
Luiz Carneiro Lima
Luiz Carneiro Lima
StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)
Group: Forum Members
Posts: 25, Visits: 87
Boa tarde Ivan,

Continuo com o problema de cast ao usar o StrataFrame...

Seguindo o tutorial consegui criar uma tela e listar alguns registros do banco de dados; mas quando mando incluir dá um erro de Cast.. Ele tenta converter 1 para inteiro...

Segue em anexo uma imagem do erro. Isso acontece quando o campo perde o foco.

Olhei na pasta de log mas não tem nenhum arquivo criado com a data de hoje...

Fico no aguardo de um contato.

Obrigada.

Angela

Attachments
problema.jpg (92 views, 252.00 KB)
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Angela, desculpa, aonde você lê "aelu Type", deveria ser "Value Type"

Nem digitar eu sei direito... BigGrin

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Ben Chase (07/19/2007)
The first problem looks fixed, but the second problem (the Int32 one) looks like the "loValue" is not really an integer.  I'm thinking she'll just have to place the loValue in the watch window so we can check what type it is.

Thanks Ben.

Angela, por favor, primeiro gostaria que você voltasse no BO Mapper e configurasse seu campo int de volta para "aelu Type"... desculpa... Blush  Depois que fizer isto, faça o Build Partial, Rebuild sua aplicação e veja se o erro continua.

Se continuar, o Ben está pedindo para você colocar o loValue na Watch Window para a gente descobrir que "type"  ele está setado no momento do erro. Se você pudesse mandar a "Stack Trace" para a gente ver também, ajudaria bastante.

StrataFrame Team
S
StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
The first problem looks fixed, but the second problem (the Int32 one) looks like the "loValue" is not really an integer.  I'm thinking she'll just have to place the loValue in the watch window so we can check what type it is.
Luiz Carneiro Lima
Luiz Carneiro Lima
StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)
Group: Forum Members
Posts: 25, Visits: 87
Foi feito sim...
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Foi feito também "Build Partial"?


Luiz Carneiro Lima
Luiz Carneiro Lima
StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)
Group: Forum Members
Posts: 25, Visits: 87
Fiz a mudança para reference type e continua apresentando o mesmo problema de cast...
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search