Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateTime Control

Status
Not open for further replies.

jshanoo

Programmer
Apr 2, 2002
287
IN
Hi,
i trying my knowledge in vb .net
the following statement in vb .net

dtpContract.Value = DateTime.Now

is giving me an error.
can anyone please help me in this
John Philip *** Even the Best, did the Bad and Made the Best ***

John Philip
 
The error is following
please tell me any referenece sites
------------
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in axinterop.mscomctl2.dll

Additional information: Exception from HRESULT: 0x800A8BCC. *** Even the Best, did the Bad and Made the Best ***

John Philip
 
Based on the error it looks like you're using the old VB6 date control, is that so? Have you tried using the .NET DateTimePicker? I don't believe you should run into such COM errors with the NET control.

I haven't used the VB6 DateTime control in a while but maybe it's having trouble decifering the time element returned by "Now." You might also try the following:

dtpContract.Value = DateTime.Now.ToShortDateString

Oli
 
Hi,
Project which trying my hand is upgraded to vb .net by the .net upgrade wizard.

in msdn vb 6, if we search by error text it gives soultion, is the same available with msdn .net

*** Even the Best, did the Bad and Made the Best ***

John Philip
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top