471,312 Members | 1,903 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Null datetime stopping position change


I have a problem with the following if the EndDate on the database is
Null. Knowing this I can code around it but not knowing it was a very
frustrating experience!

endDateTimePicker.DataBindings.Add(new Binding("Value",
MyDB.GameBindingSource, "EndDate"));

when I move position onto a record with a null enddate the BindingSource
it moves back again.

If anyone has a really good solution to the problem please let me know.

Ta
Ken

Aug 25 '08 #1
2 1270
On Aug 25, 5:18*am, Ken Foskey <rmove.fos...@optushome.com.auwrote:
I have a problem with the following if the EndDate on the database is
Null. *Knowing this I can code around it but not knowing it was a very
frustrating experience!

endDateTimePicker.DataBindings.Add(new Binding("Value",
MyDB.GameBindingSource, "EndDate"));

when I move position onto a record with a null enddate the BindingSource
it moves back again.

If anyone has a really good solution to the problem please let me know.

Ta
Ken
Hi,

Can you better explain your problem? I got confused with the "move
back"/forward
Aug 25 '08 #2
On Mon, 25 Aug 2008 08:34:02 -0700, Ignacio Machin ( .NET/ C# MVP ) wrote:
On Aug 25, 5:18Â*am, Ken Foskey <rmove.fos...@optushome.com.auwrote:
>I have a problem with the following if the EndDate on the database is
Null. Â*Knowing this I can code around it but not knowing it was a very
frustrating experience!

endDateTimePicker.DataBindings.Add(new Binding("Value",
MyDB.GameBindingSource, "EndDate"));

when I move position onto a record with a null enddate the
BindingSource it moves back again.

If anyone has a really good solution to the problem please let me know.

Ta
Ken

Hi,

Can you better explain your problem? I got confused with the "move
back"/forward
I have 4 rows. Rows 0 and 3 have dates in the EndDate column, Rows 1
and 2 do not have dates.

If I set position to 0 or 3 it works correctly, Current changes.

If I set position to 1 or 2 it very briefly changes (form title bar is
tied to the database table) and then changes back, if I start at 0 it
switches to 1 then immediately switches back to 0. If I start at 3 it
switches to 1 then immediately switches back to 3.

Once I remove the databinding on the datetime component it works fine.

This also breaks AddNew because the date time of a number of fields are
null and I have to set up the record then MoveLast to switch it.

Thanks
Ken
Aug 25 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Pet Matrix. | last post: by
8 posts views Thread by Manish Jain | last post: by
6 posts views Thread by Markus Eßmayr | last post: by
12 posts views Thread by melanieab | last post: by
5 posts views Thread by tshad | last post: by
6 posts views Thread by naurus | last post: by
4 posts views Thread by shapper | last post: by
reply views Thread by rosydwin | last post: by

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.