Questions tagged as 'nullable'

2
answers

How to convert a nullable int to common int

I have a method that receives an integer that can be null , in case some method executions happen, but when I use this same variable in a place that uses int that can not be null, it appears that the overload is incorrect....
asked by 15.05.2017 / 19:51
1
answer

Condition for verifying null variables does not work

I'm developing an ASP (Classic) page and on this page I have this: <%if(textocontrato) = "NULL" Then%> <td >Texto Contrato</td> <td ><input type="text" name="textocontrato" value="<%=textocontrato%>" size=30 m...
asked by 19.06.2017 / 13:20
1
answer

Delphi class with optional integer field

The question is: how should I build my TPESSOA class so that the _id_city field can be null. Database Create Table PESSOA ( ID INTEGER NOT NULL, NOME VARCHAR(100) NOT NULL, ID_CIDADE INTEGER) No Dephi TPESSOA = Class(TRemotable)...
asked by 03.11.2015 / 12:23
1
answer

Compiler error or code error?

I came across the following case and I do not know if it is a .Net error or error in my implementation, syntax itself (see image below). condenacaoInsert.qtd_ano_pena=null;condenacaoInsert.qtd_ano_pena=(!string.IsNullOrEmpty(readerCondenacao[...
asked by 19.03.2015 / 16:01
2
answers

Passing null parameter to a method

It is possible to pass / receive null parameters in Java. In C # I know it's possible using ? in type. public DateTime Teste(DateTime? exemplo){...} In this case the example I know can come null , in Java is this possible in...
asked by 05.11.2014 / 18:34
1
answer

IsGenericType, GetGenericTypeDefinition, and Nullable.GetUnderlyingType

In a snippet of code I was suggested to use these three members in order to check if the properties of an object are Nullable . p.PropertyType.IsGenericType && p.PropertyType.GetGenericTypeDefinition ( ) == typeof( Nullable<&g...
asked by 19.02.2017 / 00:22
1
answer

Error in the configuration of MapRoute

The following error is returned to me:    The parameters dictionary contains a null entry for parameter 'numerodeserie' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Equipment (System.String, System.String, Int32...
asked by 25.08.2016 / 13:37