473,513 Members | 7,598 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Format error

Hi,
I am attempting to troubleshoot the following error, so far with no success.

[InvalidCastException: Cast from string "06/17/2004" to type 'Date' is not valid.]
Microsoft.VisualBasic.CompilerServices.DateType.Fr omString(String Value, CultureInfo culture) +163
Microsoft.VisualBasic.CompilerServices.DateType.Fr omString(String Value) +53
cp_ContactManagement_v2_0.CallReport.Page_Load(Obj ect sender, EventArgs e) in c:\inetpub\wwwroot\cp_ContactManagement_v2_0\CallR eport.aspx.vb:243
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731

It is being generated from within a web application - here is the line that fails:

dtbOpenDate.xDate = Now.ToString("MM/dd/yyyy")

The error is generated only when the dll is run from my local host - many other machines including the server that hosts the site run it successfully. I have checked the date settings in my regional settings to no avail. If I change the formatting to "dd/MM/yyyy" it executes successfully, but then other failures occur. I have reinstalled my development environment environment but still have the problem.
I have not yet reinstalled IIS which is what I guess I will try next.

Thanks for any ideas you may have,
--
Sheldon
Jul 21 '05 #1
3 2150
Hi Sheldon,

Try setting the culture and the uiCulture in the globalization section of your web.config.

For example :

<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"
culture="nl-BE"
uiCulture="nl-BE"
/>

I experienced trouble with date formats, when I started using a new computer. It seemd that my frontend application was running in a different culture then my backend application. (Probably because my computer was installed with other regional settings, then I currently use.)

Setting this globalization solved my problem.

Kind regards,
Michel

"Sheldon" wrote:
Hi,
I am attempting to troubleshoot the following error, so far with no success.

[InvalidCastException: Cast from string "06/17/2004" to type 'Date' is not valid.]
Microsoft.VisualBasic.CompilerServices.DateType.Fr omString(String Value, CultureInfo culture) +163
Microsoft.VisualBasic.CompilerServices.DateType.Fr omString(String Value) +53
cp_ContactManagement_v2_0.CallReport.Page_Load(Obj ect sender, EventArgs e) in c:\inetpub\wwwroot\cp_ContactManagement_v2_0\CallR eport.aspx.vb:243
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731

It is being generated from within a web application - here is the line that fails:

dtbOpenDate.xDate = Now.ToString("MM/dd/yyyy")

The error is generated only when the dll is run from my local host - many other machines including the server that hosts the site run it successfully. I have checked the date settings in my regional settings to no avail. If I change the formatting to "dd/MM/yyyy" it executes successfully, but then other failures occur. I have reinstalled my development environment environment but still have the problem.
I have not yet reinstalled IIS which is what I guess I will try next.

Thanks for any ideas you may have,
--
Sheldon

Jul 21 '05 #2
Hi Sheldon,

Try setting the culture and the uiCulture in the globalization section of your web.config.

For example :

<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"
culture="nl-BE"
uiCulture="nl-BE"
/>

I experienced trouble with date formats, when I started using a new computer. It seemd that my frontend application was running in a different culture then my backend application. (Probably because my computer was installed with other regional settings, then I currently use.)

Setting this globalization solved my problem.

Kind regards,
Michel

"Sheldon" wrote:
Hi,
I am attempting to troubleshoot the following error, so far with no success.

[InvalidCastException: Cast from string "06/17/2004" to type 'Date' is not valid.]
Microsoft.VisualBasic.CompilerServices.DateType.Fr omString(String Value, CultureInfo culture) +163
Microsoft.VisualBasic.CompilerServices.DateType.Fr omString(String Value) +53
cp_ContactManagement_v2_0.CallReport.Page_Load(Obj ect sender, EventArgs e) in c:\inetpub\wwwroot\cp_ContactManagement_v2_0\CallR eport.aspx.vb:243
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731

It is being generated from within a web application - here is the line that fails:

dtbOpenDate.xDate = Now.ToString("MM/dd/yyyy")

The error is generated only when the dll is run from my local host - many other machines including the server that hosts the site run it successfully. I have checked the date settings in my regional settings to no avail. If I change the formatting to "dd/MM/yyyy" it executes successfully, but then other failures occur. I have reinstalled my development environment environment but still have the problem.
I have not yet reinstalled IIS which is what I guess I will try next.

Thanks for any ideas you may have,
--
Sheldon

Jul 21 '05 #3
Hi Sheldon,

Try setting the culture and the uiCulture in the globalization section of your web.config.

For example :

<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"
culture="nl-BE"
uiCulture="nl-BE"
/>

I experienced trouble with date formats, when I started using a new computer. It seemd that my frontend application was running in a different culture then my backend application. (Probably because my computer was installed with other regional settings, then I currently use.)

Setting this globalization solved my problem.

Kind regards,
Michel

"Sheldon" wrote:
Hi,
I am attempting to troubleshoot the following error, so far with no success.

[InvalidCastException: Cast from string "06/17/2004" to type 'Date' is not valid.]
Microsoft.VisualBasic.CompilerServices.DateType.Fr omString(String Value, CultureInfo culture) +163
Microsoft.VisualBasic.CompilerServices.DateType.Fr omString(String Value) +53
cp_ContactManagement_v2_0.CallReport.Page_Load(Obj ect sender, EventArgs e) in c:\inetpub\wwwroot\cp_ContactManagement_v2_0\CallR eport.aspx.vb:243
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731

It is being generated from within a web application - here is the line that fails:

dtbOpenDate.xDate = Now.ToString("MM/dd/yyyy")

The error is generated only when the dll is run from my local host - many other machines including the server that hosts the site run it successfully. I have checked the date settings in my regional settings to no avail. If I change the formatting to "dd/MM/yyyy" it executes successfully, but then other failures occur. I have reinstalled my development environment environment but still have the problem.
I have not yet reinstalled IIS which is what I guess I will try next.

Thanks for any ideas you may have,
--
Sheldon

Jul 21 '05 #4

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

Similar topics

11
3017
by: JN | last post by:
Hello, I use an ASP mail object to send orders filled online to a recipient via an e-mail. I would like to know if it's possible to format the way the order looks in an e-mail? I tried the...
2
9751
by: Bernd Lambertz | last post by:
I have a problem with bcp and format files. We changed our databases from varchar to nvarchar to support unicode. No problems so fare with that. It is working fine. But now I need a format...
1
14344
by: Michelle Hillard | last post by:
Hi guys, would appreciate if you can shed some light on this. Sorry to be a pain, can you tell me what is wrong with the following: for /F %%i in ('dir /b /on c:\bcp\pc*.txt') do bcp...
7
3143
by: Niall Porter | last post by:
Hi all, I'm building an ASP app on a Windows 2000/IIS machine which interfaces with our SQL Server 2000 database via OLE DB. Since we're based in the UK I want the users to be able to type in...
10
1862
by: Jack | last post by:
Hi, I cannot get the date format correctly in dynamic sql statement, after trying various ways of handling it. I need some help with the date format in the following dynamic sql statement. Any...
1
9506
by: mahnovetsky | last post by:
Does anybody know of a way to set the format property for a date field in VBA?? I need to set the property to medium so I can display display aussie dates on a graph.. Here is what Im doing: ...
1
2524
by: John Marble | last post by:
I looked around for a way to change the format and the decimal setting of a REAL type variable, but I can't seem to be able to find the synthax anywhere. Here is an exemple of what I am doing: ...
5
2499
by: blackg | last post by:
Input string not in correct format -------------------------------------------------------------------------------- I am trying to view a picture from a table. I am getting this error Input string...
8
5881
by: bienwell | last post by:
Hi, I have a problem of displaying data bound by a datalist control. In my table, I have a field Start_date which has Short Date data type. I tried to update this field by Current Date. After...
0
4155
by: Peter Nofelt | last post by:
Hi all, ISSUE: ==================== In SQL 2005 (sp2) I get the following error when preforming a bulk insert with an associated xml format file: "Could not bulk insert. Unknown version of...
0
7254
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
7432
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...
1
7094
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...
0
5677
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5079
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1585
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.