src/openSourceC.DotNetLibrary.Data/Data/DbParamsBase.cs
/// <summary>
///		Return the value of a parameter that is of a type representing a date and time value.
/// </summary>
///	<param name="parameterName">The name of the parameter.</param>
/// <param name="kind">One of the <see cref="DateTimeKind"/> values.</param>
///	<returns>Returns the value of the parameter as a nullable <see cref="DateTime"/>.</returns>
Return the value of a parameter that is of a type representing a date and time value.
Return the value of a parameter that is of a type representing a date and time value .
public DateTime? GetDateTime(string parameterName, DateTimeKind kind)
		{
			try
			{
				object? value = GetValue(parameterName);
				return (value == null ? (DateTime?)null : DateTime.SpecifyKind((DateTime)value, kind));
			}
			catch (InvalidCastException ex) { throw new InvalidCastException(string.Format(SR.Type_mismatch_on_parameter, NormalizeParameterName(parameterName)), ex); }
		}
public DateTime ? GetDateTime ( string parameterName , DateTimeKind kind ) { try { object ? value = GetValue ( parameterName ) ; return ( value == null ? ( DateTime ? ) null : DateTime . SpecifyKind ( ( DateTime ) value , kind ) ) ; } catch ( InvalidCastException ex ) { throw new InvalidCastException ( string . Format ( SR . Type_mismatch_on_parameter , NormalizeParameterName ( parameterName ) ) , ex ) ; } }
Return the value of a parameter that is of a type representing a date and time value.
Return the value of a parameter that is of a type representing a date and time value .
Returns the value of the parameter as a nullable .
Returns the value of the parameter as a nullable .
parameterName
string
The name of the parameter.
The name of the parameter .
kind
DateTimeKind
One of the
values.
One of the values .