473,403 Members | 2,293 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,403 software developers and data experts.

Dataset DateTime Null values

Does anyone know why the dataset blows up when it is reading a column
that is defined at DateTime and there are null values or empty strings?

Nov 17 '05 #1
2 4203
Blows up as in doesnt work, blows up as in the colum with that value
expands, or blows up as in your still picking the pieces to the dataset
off of the wall?

You could technically check for a null value and then give a default
date time or an empty string value in the dataset.
ds.tables[0].rows[n][n] == DBNull.Value ? new datetime(1900,1,1) : put
your actual time time here. or instead of a new datetime of 1900 do a
string.empty. This could be done at bind time, or when your populating
some data. Just an idea i guess.

Nov 17 '05 #2
Give more details about your problem

you should be able to read a null DateTime column, of course assuming that
the column support null values.

where r u reading the data from?

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"John S" <jo********@cinfin.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
Does anyone know why the dataset blows up when it is reading a column
that is defined at DateTime and there are null values or empty strings?

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Andreas Palm | last post by:
I have a dataset that has DBNull in certain columns, now when I write out this one to XML, I only get the columns as elements that do have data in it. However I do need also the empty colums as...
8
by: drg | last post by:
I have a DataSet with a DateTime field. I am using an EventRow r, to update it with values from a TextBox in a DataGrid. Suppose a DataGrid in edit mode had a field with value: 7/7/2005. Then the...
1
by: Matt Tinson | last post by:
Hello I have a datagrid with a datetimepicker column in it, which is bound to a dataset (MyDataset). The column in the dataset set that is mapped to the datetimepicker is called MyOrderDate and...
7
by: Clamara | last post by:
When adding a new record from my form, I pre-set my DateTimePicker's value to System.DateTime.Today Since the "Today" value is used most of the time, the user doesn't need to select a date from...
5
by: Andrew | last post by:
Hi all, I have a dataset which I pass back from my webservice to my app. In my webservice, it looks like this: ds.Tables I want to access the datatable in my dataset in my app after it has...
0
by: Mateusz [PEYN] Adamus | last post by:
Hi I have a Typed DataSet. I've databinded it to some text controls on my form, controls show data when I show record. But now I would like to create a new record with this form, controls...
4
by: SteveT | last post by:
I am wanting to populate several treeviews, one for the <TRs> group and one for the <TGsgroup. Is there a simplier way to populate the Treeview than the one I did below? It seems difficult to...
1
by: | last post by:
I'm querying Index Server to return search results, both regular properties and some custom properties I've created. Index Server has this preference for thinking about information as strings...
5
by: =?Utf-8?B?UlBhcmtlcg==?= | last post by:
I used the wizard to generate a typed dataset for my table and let it create my SPROCs. It created everything, and the GetData() method and the custom GetByUserName query works great, but when I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.