Here are the examples of the csharp api class System.Data.Common.DbDataReader.GetDateTime(int) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
31 Examples
0
1. Example
View licensepublic override DateTime GetDateTime(int ordinal) { return InnerReader.GetDateTime(ordinal); }
0
2. Example
View licensepublic static DateTime? GetNullableTime(this DbDataReader reader, int index) { return reader.GetDateTime(index); }
0
3. Example
View licensepublic override DateTime GetDateTime(int ordinal) { return InnerDataReader.GetDateTime(ordinal); }
0
0
5. Example
View licensepublic override DateTime GetDateTime(int ordinal) { //OracleDateTime dateTime = source.GetOracleDateTime(ordinal); //return dateTime.Value; return source.GetDateTime(ordinal); }
0
0
0
8. Example
View licensepublic override DateTime GetDateTime(int i) { return _reader.GetDateTime(i); }
0
9. Example
View licensepublic override DateTime GetDateTime(int ordinal) { return _reader.GetDateTime(ordinal); }
0
10. Example
View licensepublic override DateTime GetDateTime(int ordinal) { return wrappedReader.GetDateTime(ordinal); }
0
11. Example
View licensepublic static DateTime ToDateTime(this DbDataReader reader, int index) { return reader.IsDBNull(index) ? LibraryDefaults.Default_DateTime : reader.GetDateTime(index); }
0
12. Example
View licensepublic static DateTime? ToDateTimeNullable(this DbDataReader reader, int index) { return reader.IsDBNull(index) ? (DateTime?)null : reader.GetDateTime(index); }
0
13. Example
View licensepublic static int GetTimeTick(this DbDataReader reader, int index) { var datetime = reader.GetDateTime(index); var value = datetime.Subtract(new DateTime(1900, 1, 1)); long num2 = value.Ticks - value.Days * 864000000000; if (num2 < 0) num2 += 864000000000; int num3 = (int)(num2 / 10000.0 * 0.3 + 0.5); if (num3 > 300 * 60 * 60 * 24 - 1) num3 = 0; return num3; }
0
14. Example
View licensepublic static DateTime? GetNullableTime(this DbDataReader reader, int index) { SqlDataReader dataReader = reader as SqlDataReader; if (dataReader == null) return reader.GetDateTime(index); var svr = dataReader.GetSqlDateTime(index); return svr.IsNull ? default(Nullable<DateTime>) : svr.Value; }
0
15. Example
View licensepublic static DateTime non_null_dt(DbDataReader rs, int idx) { return rs.IsDBNull(idx) ? DateTime.MinValue : rs.GetDateTime(idx); }
0
16. Example
View licensepublic DateTime GetDateTime(int ordinal) { LastOrdinal = ordinal; DateTime dt; switch (typeCodes[ordinal]) { case TypeCode.DateTime: dt = reader.GetDateTime(ordinal); break; default: dt = ReflectionTools.ChangeType<DateTime>(reader.GetValue(ordinal)); break; } if (Schema.Current.TimeZoneMode == TimeZoneMode.Utc) return new DateTime(dt.Ticks, DateTimeKind.Utc); return dt; }
0
17. Example
View licensepublic static int GetTimeTick(this DbDataReader reader, int index) { SqlDataReader dataReader = reader as SqlDataReader; if (dataReader != null) { return dataReader.GetSqlDateTime(index).TimeTicks; } var datetime = reader.GetDateTime(index); var value = datetime.Subtract(new DateTime(1900, 1, 1)); long num2 = value.Ticks - value.Days * 864000000000; if (num2 < 0) num2 += 864000000000; int num3 = (int)(num2 / 10000.0 * 0.3 + 0.5); if (num3 > 300 * 60 * 60 * 24 - 1) num3 = 0; return num3; }
0
18. Example
View licensepublic object NullSafeGet(DbDataReader rs, string[] names, ISessionImplementor session, object owner) { int ordinal = rs.GetOrdinal(names[0]); if (rs.IsDBNull(ordinal)) { return DateTime.MinValue; } else { return rs.GetDateTime(ordinal); } }
0
19. Example
View licensepublic override DateTime GetDateTime(int ordinal) { if (this.IsDBNull(ordinal)) throw new SqlNullValueException(string.Format("Column contains {0} DBNull", ordinal)); return _resultsReader.GetDateTime(ordinal); }
0
20. Example
View licenseprivate log_entry_line line_from_reader() { log_entry_line row = new log_entry_line(); /n ..... /n //View Source file for more details /n }
0
21. Example
View licenseprivate MembershipUser GetUserFromReader(DbDataReader reader) { object providerU/n ..... /n //View Source file for more details /n }
0
22. Example
View licenseX509CrlRecord LoadCrlRecord (DbDataReader reader, X509CrlParser parser, ref byte[] buffer) { var record = new X509CrlRecord (); for (int i = 0; i < reader.FieldCount; i++) { switch (reader.GetName (i).ToUpperInvariant ()) { case "CRL": record.Crl = DecodeX509Crl (reader, parser, i, ref buffer); break; case "THISUPDATE": record.ThisUpdate = DateTime.SpecifyKind (reader.GetDateTime (i), DateTimeKind.Utc); break; case "NEXTUPDATE": record.NextUpdate = DateTime.SpecifyKind (reader.GetDateTime (i), DateTimeKind.Utc); break; case "DELTA": record.IsDelta = reader.GetBoolean (i); break; case "ID": record.Id = reader.GetInt32 (i); break; } } return record; }
0
23. Example
View licenseprotected virtual async Task<DateTime> UsePreparedStatementAsync(string timestampSelectString, ISessionImplementor session, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); var tsSelect = new SqlString(timestampSelectString); DbCommand ps = null; DbDataReader rs = null; using (session.BeginProcess()) { try { ps = await (session.Batcher.PrepareCommandAsync(CommandType.Text, tsSelect, EmptyParams, cancellationToken)).ConfigureAwait(false); rs = await (session.Batcher.ExecuteReaderAsync(ps, cancellationToken)).ConfigureAwait(false); await (rs.ReadAsync(cancellationToken)).ConfigureAwait(false); var ts = rs.GetDateTime(0); log.DebugFormat("current timestamp retreived from db : {0} (ticks={1})", ts, ts.Ticks); return ts; } catch (DbException sqle) { throw ADOExceptionHelper.Convert( session.Factory.SQLExceptionConverter, sqle, "could not select current db timestamp", tsSelect); } finally { if (ps != null) { try { session.Batcher.CloseCommand(ps, rs); } catch (DbException sqle) { log.Warn("unable to clean up prepared statement", sqle); } } } } }
0
24. Example
View licenseprotected virtual DateTime UsePreparedStatement(string timestampSelectString, ISessionImplementor session) { var tsSelect = new SqlString(timestampSelectString); DbCommand ps = null; DbDataReader rs = null; using (session.BeginProcess()) { try { ps = session.Batcher.PrepareCommand(CommandType.Text, tsSelect, EmptyParams); rs = session.Batcher.ExecuteReader(ps); rs.Read(); var ts = rs.GetDateTime(0); log.DebugFormat("current timestamp retreived from db : {0} (ticks={1})", ts, ts.Ticks); return ts; } catch (DbException sqle) { throw ADOExceptionHelper.Convert( session.Factory.SQLExceptionConverter, sqle, "could not select current db timestamp", tsSelect); } finally { if (ps != null) { try { session.Batcher.CloseCommand(ps, rs); } catch (DbException sqle) { log.Warn("unable to clean up prepared statement", sqle); } } } } }
0
25. Example
View license[HttpGet] public async Task<IActionResult> Index() { // [START exa/n ..... /n //View Source file for more details /n }
0
26. Example
View licenseX509CertificateRecord LoadCertificateRecord (DbDataReader reader, X509CertificateParser parser, ref byte[] buffer) { var record = new X509CertificateRecord (); for (int i = 0; i < reader.FieldCount; i++) { switch (reader.GetName (i).ToUpperInvariant ()) { case "CERTIFICATE": record.Certificate = DecodeCertificate (reader, parser, i, ref buffer); break; case "PRIVATEKEY": record.PrivateKey = DecodePrivateKey (reader, i, ref buffer); break; case "ALGORITHMS": record.Algorithms = DecodeEncryptionAlgorithms (reader, i); break; case "ALGORITHMSUPDATED": record.AlgorithmsUpdated = DateTime.SpecifyKind (reader.GetDateTime (i), DateTimeKind.Utc); break; case "TRUSTED": record.IsTrusted = reader.GetBoolean (i); break; case "ID": record.Id = reader.GetInt32 (i); break; } } return record; }
0
27. Example
View licenseprotected override IEnumerable<JournalEntry> GetJournalEntriesFromImpl(ulong entryId) { var connection = CreateConnection(); var dbCommand = connection.CreateCommand(); var parameter = dbCommand.CreateParameter(); parameter.ParameterName = "@id"; parameter.DbType = DbType.Int64; parameter.Value = entryId; dbCommand.Parameters.Add(parameter); dbCommand.CommandText = _statements.ReadEntries; connection.Open(); using (connection) { var reader = dbCommand.ExecuteReader(); while (reader.Read()) { var id = (ulong)reader.GetInt64(0); var created = reader.GetDateTime(1); var item = _formatter.FromByteArray<object>((byte[])reader[2]); yield return JournalEntry.Create(id, created, item); } reader.Close(); } }
0
28. Example
View license[Test] public void TestTimeZone() { // Use a time in the UTC time zone; /n ..... /n //View Source file for more details /n }
0
29. Example
View licenseprivate void UpdateFailureCount(string username, string failureType) { EnsureTab/n ..... /n //View Source file for more details /n }
0
30. Example
View licensepublic string GetString(int ordinal) { LastOrdinal = ordinal; if (reader.IsDBNull(ordinal)) { return null; } switch (typeCodes[ordinal]) { case TypeCode.Byte: return reader.GetByte(ordinal).ToString(); case TypeCode.Int16: return reader.GetInt16(ordinal).ToString(); case TypeCode.Int32: return reader.GetInt32(ordinal).ToString(); case TypeCode.Int64: return reader.GetInt64(ordinal).ToString(); case TypeCode.Double: return reader.GetDouble(ordinal).ToString(); case TypeCode.Single: return reader.GetFloat(ordinal).ToString(); case TypeCode.Decimal: return reader.GetDecimal(ordinal).ToString(); case TypeCode.DateTime: return reader.GetDateTime(ordinal).ToString(); case tcGuid: return reader.GetGuid(ordinal).ToString(); case TypeCode.String: return reader.GetString(ordinal); default: return reader.GetValue(ordinal).ToString(); } }
0
31. Example
View licenseprivate Delegate GetValuesGetter(int ind, MemberInfo m) { var memberType = ReflectionUtils.Ge/n ..... /n //View Source file for more details /n }