Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Server Side Programming Articles
Page 862 of 2109
DateTime.AddMilliseconds() Method in C#
The DateTime.AddMilliseconds() method in C# is used to add a specified number of milliseconds to a DateTime instance. This method returns a new DateTime object with the updated value, leaving the original DateTime unchanged. Syntax Following is the syntax − public DateTime AddMilliseconds(double value); Parameters value − A double representing the number of milliseconds to add. Can be positive or negative. Return Value Returns a new DateTime object whose value is the sum of the date and time represented by this instance and the number of milliseconds ...
Read MoreDateTime.AddMinutes() Method in C#
The DateTime.AddMinutes() method in C# is used to add the specified number of minutes to the value of a DateTime instance. It returns a new DateTime object representing the calculated time without modifying the original instance. Syntax Following is the syntax − public DateTime AddMinutes(double minutes); Parameters minutes − A double value representing the number of minutes to add. The value can be positive (to add minutes) or negative (to subtract minutes). Fractional values are allowed. Return Value Returns a new DateTime object whose value is the sum of the date ...
Read MoreType.GetMember() Method in C#
The Type.GetMember() method in C# is used to retrieve information about specified members of the current Type using reflection. It returns an array of MemberInfo objects that represent the members matching the specified name and binding criteria. Syntax Following are the syntax variations for the Type.GetMember() method − public System.Reflection.MemberInfo[] GetMember(string name); public virtual System.Reflection.MemberInfo[] GetMember(string name, System.Reflection.BindingFlags bindingAttr); Parameters name − A string specifying the name of the member to search for. bindingAttr − A combination of BindingFlags values that control how the search is conducted. ...
Read MoreDateTime.AddMonths() Method in C#
The DateTime.AddMonths() method in C# is used to add the specified number of months to the value of a DateTime instance. This method returns a new DateTime object representing the date after adding the specified months, while the original DateTime remains unchanged. Syntax Following is the syntax for the DateTime.AddMonths() method − public DateTime AddMonths(int months); Parameters months − An integer representing the number of months to add. Use positive values to add months and negative values to subtract months. The value can range from -120, 000 to 120, 000. Return Value ...
Read MoreDateTime.AddSeconds() Method in C#
The DateTime.AddSeconds() method in C# is used to add the specified number of seconds to the value of this instance. This returns a new DateTime object without modifying the original DateTime instance. Syntax Following is the syntax − public DateTime AddSeconds(double sec); Parameters sec − A double value representing the number of seconds to be added. If you want to subtract seconds, then set a negative value. The value can include fractional seconds. Return Value This method returns a new DateTime object that represents the date and time after adding the ...
Read MoreDateTime.AddTicks() Method in C#
The DateTime.AddTicks() method in C# is used to add a specified number of ticks to the value of this instance. It returns a new DateTime representing the adjusted time. A tick represents 100 nanoseconds, making this method useful for precise time calculations. Syntax Following is the syntax − public DateTime AddTicks(long ticks); Parameters ticks: A long value representing the number of ticks to add. Each tick equals 100 nanoseconds. Positive values add time, while negative values subtract time. Return Value Returns a new DateTime object whose value is the sum of ...
Read MoreInt16.GetTypeCode Method in C# with Examples
The Int16.GetTypeCode() method in C# is used to return the TypeCode for value type Int16. This method is part of the IConvertible interface and helps identify the underlying data type at runtime. The TypeCode enumeration provides a way to categorize the data types supported by the Common Language Runtime (CLR). For Int16 values, this method always returns TypeCode.Int16. Syntax Following is the syntax − public TypeCode GetTypeCode(); Return Value This method returns TypeCode.Int16, which is the enumerated constant representing the Int16 type. Using GetTypeCode() with Int16 Values Example Let ...
Read MoreInt32.CompareTo Method in C# with Examples
The Int32.CompareTo method in C# is used to compare the current integer instance with another integer or object and returns an indication of their relative values. This method is particularly useful for sorting operations and conditional comparisons. Syntax The Int32.CompareTo method has two overloads − public int CompareTo(int value); public int CompareTo(object value); Parameters value − An integer or object to compare with the current instance. Return Value Return Value Condition Meaning Less than zero (< 0) Current instance < ...
Read MoreDecimal.FromOACurrency() Method in C#
The Decimal.FromOACurrency() method in C# converts a 64-bit signed integer containing an OLE Automation Currency value to its equivalent decimal representation. OLE Automation Currency stores currency values as scaled integers, where the value is multiplied by 10, 000 to preserve four decimal places of precision. Syntax Following is the syntax for the Decimal.FromOACurrency() method − public static decimal FromOACurrency(long val); Parameters val: A 64-bit signed integer that contains an OLE Automation Currency value to be converted. Return Value Returns a decimal value equivalent to the OLE Automation Currency value. The returned ...
Read MoreType.GetNestedType() Method in C#
The Type.GetNestedType() method in C# is used to retrieve a specific nested type that is declared within the current type. This method is part of the System.Reflection namespace and provides access to nested classes, interfaces, structs, or other types defined inside a parent type. Syntax Following are the overloads for the GetNestedType() method − public Type GetNestedType(string name); public abstract Type GetNestedType(string name, System.Reflection.BindingFlags bindingAttr); Parameters name − The string containing the simple name of the nested type to get. bindingAttr − A combination of enumeration values that specify how the search ...
Read More