473,387 Members | 1,456 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,387 software developers and data experts.

Automaticaly insert current date in a . net webpage

I'm trying to get a small webpage to update an access database. There are no problems with the data the user enter but when I try to update the database with current date and time it fails.
I'm using a FormView to enter data.
Expand|Select|Wrap|Line Numbers
  1. If Not IsPostBack Then
  2.             '==========>Update db with current date and time
  3.             Me.dsFelLogg.InsertParameters.Item("Feldatum").DefaultValue = DateTime.Now.ToShortDateString
  4.             Me.dsFelLogg.InsertParameters.Item("FelTid").DefaultValue = DateTime.Now.ToShortTimeString
  5.         End If
  6.  
It always return an empty field in the database
Attached Files
File Type: zip ByteQuestion.zip (9.7 KB, 62 views)
May 23 '11 #1
1 1885
Frinavale
9,735 Expert Mod 8TB
Is the Feldatum and the FelTid fields String types?

It could be that you aren't supplying the correct type of data to the database...although I'm not sure why an exception isn't thrown if this is the case.
May 31 '11 #2

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

Similar topics

3
by: Michael Hertz | last post by:
I am performing a XSLT stylesheet on a XML document and produce a new XML document. How can I insert in this new XML stylesheet a tag <currtime>..."the current date/time"....</currtime> where...
2
by: toedipper | last post by:
Hello, I have the following section of php code which updates a mysql record from a form. For the values of livedate and livetime I need to insert the current_date() and current_time()...
5
by: ryan.mclean | last post by:
Hi all, I have a question about inserting records into sql server. I am brand new to sql server, always using oracle previously. Before today, I had always written statement such as this: ...
2
by: lphuong | last post by:
Access 2000 I have a fldCreateDate on frmCustomer(mainform)and also a fldCreateDate on frmCustomerVisit(subform). They are one to many relationship. On the main form, frmCustomer, I have a...
3
by: | last post by:
I have a datetime field in table. I want to insert the current time of database server to the table thr ASP.NET (C#). I have dataset to do the insert: DataSet1.TableNameRow rowNew =...
6
by: vijayk | last post by:
Hi all, I have a field which has data as YYYYMMDD, and I have to find the age of the person by substracting it from current date. can you please please advice... thanks
3
by: Phillip Vong | last post by:
Using VS2005 w/ simple aspx in VB.net I have a simple databound textbox "LastMtgText" in a formview in the Insert template. All I want to do is make the default date of today when someone goes...
4
by: sharmilah | last post by:
Hi all I want to save the current date in a database field in the following format dd/mm/yyyy for example 18/06/2007. How can i do this. The following is code I've used to assign nulls to my...
3
by: jomats | last post by:
I am a newbie trying to learn Access from several books. I'm sure this is an easy one to answer..for someone, not me. Is it possible to insert a checkbox on a form which, when checked, inserts the...
3
by: perhapscwk | last post by:
I using a insert query to insert some data into mysql. I use now() as the current date and time but it always have 3.X hours different from actual date. what i should use instead? thanks.
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
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,...
0
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...
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
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...

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.