Thread
:
Specified cast is not valid
View Single Post
#
8
(
permalink
)
03-12-2008, 08:17 AM
Erel
Administrator
Join Date: Apr 2007
Posts: 3,325
When you read a value from a table that value must not be null.
You can use the COALESCE keyword which replaces NULLs with a default value.
Code:
SqlCommand.CommandText="Select COALESCE(cod_asl,0) FROM T_Certificati where ID_certificato=1"
Erel
View Public Profile
Send a private message to Erel
Find all posts by Erel