Monday, February 19, 2018

Dotnet Tutorial 3 Operators

Operators

1. Assignment
2. Arithmetic Operators
3. Comparison Operators
4. Conditional Operator
5. Ternary Operator




Default Values of Data Types in Dot Net:

1. Null Value Type : Int , Float , Boolean , structs , enum etc.
2. Reference Value Type : Class,Interface,Delegates,Arrays etc.

Like in NAV , we generally dont care about default values of Variables and simply use CLEAR Function. But in Dotnet you need to be very curious about nullable value because you are going to use database anyhow to store and record the result.

Database concept is containing NULL value so how can we do this in Dotnet because here we need to work with variables like int and it can't contain Null value directly.

See this , how we can simply put ? after variable and can store null also in a variable.


Convertion of One DataType to Another DataType :

Yes , Its seriously required in Dotnet programming. Normally we dont need this functionality too much in NAV programming.

Simply we need to use Convert.Datatype.

NORMALLY WE ONLY USE format IN NAV.

Use Of Parse and TryParse

Parse : This function is used for converting the datatypes but it can give you Error if conversion is not successful.

TryParse : This function is will not throw error and program will run smoothly without stoping the process.





No comments:

Post a Comment