ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

Stupid database date picker

(1/1)

chedabob:
Right, so I have a date picker, for my database. The only problem is, despite the fact that the date is shown onscreen, its never passed into the database, unless the user clicks a value. See, its not normally a problem, but if the date selected is already correct, the average user won't change it. So then it doesn't go into the database, and when I search later, I can't find it, because there is no date.

So, is there an easy way to force the database to use the value shown onscreen?

tinjaw:
I'd love to help, but I have no clue what you doing. What language are you programming in? What tools are you developing in? How are you connecting to the database? etc.

chedabob:
Oops, forgot to mention.


Im using C#, in Visual C# Express 2005

I connected the database with the standard "Add data source" wizard.

tinjaw:
In general terms there should be an event for when the data is being committed to the database. In that event check the value of the date field. If the value is null, then grab the value of the calendar control. Set the data field to the value of the calendar control.

Sorry, but I don't know C#, [ yet  ;) ], nor do I have Visual C# installed, so I can't be more specific than that presently. But the info I've provided should get you where you need to be.

chedabob:
Well, I found a default value setting with the TableAdaptor, but it throws a wobbler when I set it. Im gonna speak to my tutor at college, when it opens again (the roof blew off :O)

Navigation

[0] Message Index

Go to full version