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

specifying a date literal?

djc
MyVariable = #1/1/2099#, which is how I used to do this, throws an
exception? "... "cannot be converted to type date". So I'm assuming there
was a syntax change in .net? To be more specific, the line of my code
causing the compile error is this:

val_rv_txtETA.MaximumValue = #01/01/2099#

val_rv_txtETA is an asp.net rangevalidator control.

any info would be greatly appreciated. Thanks.
Nov 21 '05 #1
4 2509
DJC,

In my opinion the most sure way in all cultures

dim whateverdatetimeformat as datetime = new datetime(2099,01,01)

I hope this helps,

Cor

"djc" <no***@nowhere.com>
MyVariable = #1/1/2099#, which is how I used to do this, throws an
exception? "... "cannot be converted to type date". So I'm assuming there
was a syntax change in .net? To be more specific, the line of my code
causing the compile error is this:

val_rv_txtETA.MaximumValue = #01/01/2099#

val_rv_txtETA is an asp.net rangevalidator control.

any info would be greatly appreciated. Thanks.

Nov 21 '05 #2
"djc" <no***@nowhere.com> schrieb_
MyVariable = #1/1/2099#, which is how I used to do this, throws an
exception? "... "cannot be converted to type date". So I'm assuming there
was a syntax change in .net? To be more specific, the line of my code
causing the compile error is this:

val_rv_txtETA.MaximumValue = #01/01/2099#

.... works fine for me (if 'MaximumValue' is of type 'DateTime' (= 'Date').

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #3
djc
thanks for the reply. I appreciate it. I don't know why but as long as I
first put the values for MinimumValue and MaximumValue in the asp.net
RangeValidator tag itself (like so: MinimumValue="1/1/2004"
MaximumValue="1/1/2099") then I can change those properties programatically
as the line from my original post does. If they are not there in the asp tag
then when I try to change them programatically I get that error...
strange... well, strange unless you know why. hehe.

thanks again.

"Cor Ligthert" <no************@planet.nl> wrote in message
news:u7**************@TK2MSFTNGP09.phx.gbl...
DJC,

In my opinion the most sure way in all cultures

dim whateverdatetimeformat as datetime = new datetime(2099,01,01)

I hope this helps,

Cor

"djc" <no***@nowhere.com>
MyVariable = #1/1/2099#, which is how I used to do this, throws an
exception? "... "cannot be converted to type date". So I'm assuming there was a syntax change in .net? To be more specific, the line of my code
causing the compile error is this:

val_rv_txtETA.MaximumValue = #01/01/2099#

val_rv_txtETA is an asp.net rangevalidator control.

any info would be greatly appreciated. Thanks.


Nov 21 '05 #4
djc
thanks for the reply. I appreciate it. I don't know why but as long as I
first put the values for MinimumValue and MaximumValue in the asp.net
RangeValidator tag itself (like so: MinimumValue="1/1/2004"
MaximumValue="1/1/2099") then I can change those properties programatically
as the line from my original post does. If they are not there in the asp tag
then when I try to change them programatically I get that error...
strange... well, strange unless you know why. hehe.

thanks again.

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eX****************@TK2MSFTNGP14.phx.gbl...
"djc" <no***@nowhere.com> schrieb_
MyVariable = #1/1/2099#, which is how I used to do this, throws an
exception? "... "cannot be converted to type date". So I'm assuming there was a syntax change in .net? To be more specific, the line of my code
causing the compile error is this:

val_rv_txtETA.MaximumValue = #01/01/2099#

... works fine for me (if 'MaximumValue' is of type 'DateTime' (= 'Date').

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much...
3
by: dthmtlgod | last post by:
I am trying to insert a date into a date field through my website. The date is pre-populated with todays date. I am getting a type mismatch error. The Access DB is setup as a Date/Time Short...
15
by: Simon Brooke | last post by:
I'm investigating a bug a customer has reported in our database abstraction layer, and it's making me very unhappy. Brief summary: I have a database abstraction layer which is intended to...
10
by: Amittai Aviram | last post by:
This XHTML 1.0 Strict page -- http://www.studiolirico.org/docs/settimana2003.html has a bilingual title in Italian and English. The principle language of the page is Italian, so the <html> tag...
8
by: kevcar40 | last post by:
Hi I have a excel worksheet that contains a lot of data one on the columns is the date(formatted as short date "dd/mm/yyyy) i import this worksheet into access as a table the date field is...
4
by: Bilgehan.Balban | last post by:
Hi, The following code: #include <stdio.h> // const int const_asize = 10; #define define_asize = 10; int array = {1,2,3,4,5,6,7,8,9,0};
28
by: richardlang | last post by:
Anyone out there ever come across a preprocessor macro that compares an argument value against the predefined __DATE__ macro in order to control conditional compilation based on date. Something...
2
by: syntego | last post by:
We commonly use triggers to log changes to our main tables to historical log tables. In the trigger, we create a concatenated string of the old values by casting them as follows: ...
4
by: odavison | last post by:
I'm currently running a crosstab query that displays the total amounts of Appointments that each Consultant. Currently it is Consultant ID as the Rows, and Appointment Date as the top headings,...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.