473,378 Members | 1,317 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Get current datetime on nullable sql field

Sl1ver
196 100+
I retrieve a null value from a nullable sql datacolumn but when I pull it into a property it automatically gets the current datetime.

How will I go about making sure that this value returns a null and not the currentdatetime.
Jun 28 '12 #1
1 1737
Sl1ver
196 100+
I figured out the problem. I was using
Expand|Select|Wrap|Line Numbers
  1. DataFunctions.CastDateTime(record["usrLastLoginStampDate"]);
instead of nullabledatetime like
Expand|Select|Wrap|Line Numbers
  1. DataFunctions.CastNullableDateTime(record["usrLastLoginStampDate"]);
Jun 28 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: MarthaR | last post by:
I am trying to add the current time to a field when the user clicks on the toggle button next to the field. I am getting a time of 12:00:00 AM each time I click the button. How do I get a...
1
by: Kevin | last post by:
Hi All I have a DateTime object called dt. the format of dt.Date is mm/dd/yyyy. How can I change this format to dd/mm/yyyy and still keep it as a DateTime object so that I can run this...
4
by: ESPNSTI | last post by:
Hi, Please don't shoot me if the answer is simple, I'm new to .Net and C# :) .. I'm attempting to convert a nullable type to it's "non-nullable" type in a generic way (without knowing what...
5
by: Child | last post by:
I have a class object with a couple of datetime variables that are not required (for example the closing date for an event). I have been doing some research on usenet history to find that this is...
5
by: GG | last post by:
I am trying to add a nullable datetime column to a datatable fails. I am getting exception DataSet does not support System.Nullable<>. None of these works dtSearchFromData.Columns.Add( new...
4
by: Jose Fernandez | last post by:
Hello. how can i cast a null value from a datareader (System.DBNull) to dateTime I have an object. One of its fields is a DateTime type field. From the database i am getting System.DBNull values...
2
by: Benton | last post by:
Hi there, I'm creating a custom server control, inheriting from TextBox. It has this AsDateTime property that returns the textbox contents converted to the nullable DateTime data type, as...
3
by: howa | last post by:
a statement as simple as that, but not working,... <xsl:variable name="now" select="current-dateTime()" /> I can't find a working example in the Internet...
2
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hi mister, I have an object with two properties, of type DateTime? (Nullable). Which is the best way for comparing ? The value of datetime can be null, and another value cannot be null, or two...
4
by: James | last post by:
hello, can we have a nullable type field in the struct ? struct Employee { nullable<stringfirstName =null; } we can't initialize a field in a struct so is there any possibility that we can...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.