I have a question about converting data type nvarchar to decimal, in a procedure when i update those informations my solution break in a error about converting. So this is my code:
objGrupoCadCom.CusteioSegurado = decimal.Parse(txtCusteioSegurado.Text);
objGrupoCadCom.CusteioEstipulante = decimal.Parse(txtCusteioEstipulante.Text);
objGrupoCadCom.ProLabore = decimal.Parse(txtProLabore.Text);
and this is my error:
"Erro ao Alterar Cadastro Grupo Complementar: Error converting data type nvarchar to decimal."
Anybody know how i fix this error ?? I use C# and Aspx to do this solution.
Thanks.
My Procedure:
So, this is my Procedure.
CREATE PROCEDURE VEW_GrupoCadastroComplementar_Alterar (
@IdGrupo int
, @IdRamoAtividade int
, @Endereco varchar(60)
, @Numero varchar(8)
, @CEP varchar(9)
, @Complemento varchar(60)
, @Bairro varchar(30)
, @Cidade varchar(30)
, @UF varchar(2)
, @DDD varchar(4)
, @Telefone varchar(9)
, @SituacaoFinanceira varchar(20)
, @ComplementoGrupoLivre varchar(max)
, @CusteioSeguro varchar(20)
, @PagamentoPremio varchar(20)
, @CusteioEstipulante decimal(10,2)
, @CusteioSegurado decimal(10,2)
, @ProLabore decimal(10,2)
, @ProLaboreDocumento varchar(3)
)
AS
SET NOCOUNT ON
UPDATE VEW_Grupo
SET
IdRamoAtividade = @IdRamoAtividade
, Endereco = @Endereco
, Numero = @Numero
, CEP = @CEP
, Complemento = @Complemento
, Bairro = @Bairro
, Cidade = @Cidade
, UF = @UF
, DDD = @DDD
, Telefone = @Telefone
, SituacaoFinanceira = @SituacaoFinanceira
, ComplementoGrupoLivre = @ComplementoGrupoLivre
, CusteioSeguro = @CusteioSeguro
, PagamentoPremio = @PagamentoPremio
, CusteioEstipulante = @CusteioEstipulante
, CusteioSegurado = @CusteioSegurado
, ProLabore = @ProLabore
, ProLaboreDocumento = @ProLaboreDocumento
WHERE
idGrupo = @idGrupo
SET NOCOUNT OFF
WHERE
idGrupo = @idGrupo
SET NOCOUNT OFF