473,804 Members | 3,311 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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!

endDateTimePick er.DataBindings .Add(new Binding("Value" ,
MyDB.GameBindin gSource, "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 1352
On Aug 25, 5:18*am, Ken Foskey <rmove.fos...@o ptushome.com.au wrote:
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!

endDateTimePick er.DataBindings .Add(new Binding("Value" ,
MyDB.GameBindin gSource, "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...@o ptushome.com.au wrote:
>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!

endDateTimePic ker.DataBinding s.Add(new Binding("Value" ,
MyDB.GameBindi ngSource, "EndDate")) ;

when I move position onto a record with a null enddate the
BindingSourc e 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
24677
by: Pet Matrix. | last post by:
Hi, I am having the schema and one element in that schema is , <xs:element name="EndT" type="TstampType" minOccurs="1" maxOccurs="1"/> How do I represent the NULL value for the datatype dateTime in the xml.
8
19251
by: Manish Jain | last post by:
Platform : ASP.Net/C# void SomeFunction(DateTime date) { string text = date.ToString(); //This crashes if date is null } I am using a construct similar to above. I want to check if the date is null or nor before processing it, but I am not able to figure out the syntax.
6
6528
by: Markus Eßmayr | last post by:
Hello, I'd like to consume a WebService, which returns an array of objects which include several members of type System.String, System.Decimal and System.DateTime. In the WSDL-file, the members of the object are marked as nilable. I generated the client classes using VS.NET 2003. After the creation, I got the class-definition of the objects returned by the WebService too. BUT, only the System.String members where marked to be nullable,...
12
1499
by: melanieab | last post by:
Hi, I'm trying to check and see if something other than numbers (either the +, -, *, or /) are entered into a textbox, where bigR is what I call the text in the textbox. I can get what was entered and where along the string (the where part is the first section of below). I'm running into trouble just after that. I tested what the value of breakpt and got 3, which it should be if entering something like 100 + 200. But when I run the for...
5
2156
by: tshad | last post by:
I have the following code: *************************************************************************** Dim CommandText as String = "INSERT INTO ftsolutions.dbo.position (client,dateposted) VALUES ( @client,@dateposted)" Dim objCmd as New SqlCommand(CommandText,objConn) with objCmd.Parameters .Add("@client",SqlDbType.Char,50).value = "the companies next test" .Add("@dateposted",SqlDbType.datetime).value = dateposted.text
5
2639
by: AAJ | last post by:
Hi Does anyone know of any good publically available set of standards for managing dates when dealing with a database server (in my case SQL Server 2000 and c# VS2005). At the moment, if I create a record in the database for say a job, the invoicedOn date field will be left null within the data base, not being assigned untill its actually invoiced.
6
2122
by: naurus | last post by:
i'm making a javascript visualization effect, and i'm having some trouble with the stopping the main function when a certain particle reaches 100% height: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> <title>$P4rk5</title> <script>
0
2604
by: tschroeder250 | last post by:
Hi Everyone, There are so many Nullable DateTimePickers out there that this post may not even be found among all the others, but I wanted to try. First, I want to thank all the authors of the code I used as a starting point. Second, I hope this code helps someone as much as they helped me. I have built a Nullable DateTimePicker and NullableCalendarColumn/Cell/EditingControl that is nearly 100% complete, as far as I can tell. There is...
4
7197
by: shapper | last post by:
Hello, I have the following: DateTime c = database.Posts.Max(b =b.CreatedAt).Value; b.CreatedAt is of type "DateTime?" The problem is when database.Posts is empty. I get an error: Nullable object must have a value.
0
9708
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9588
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10589
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10327
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3828
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.