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

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 2139
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
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
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
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
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
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
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
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
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
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
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
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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: 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
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
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.