473,386 Members | 1,647 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.

Exception: "Input string was not in a correct format."

dan
I am using VB.NET 2003 and SQL Server 2000.

The program uses ADO.NET .

The following instruction:

Me.cd_insertDataRecord.ExecuteNonQuery()
throws this exception:
">>>ProcessDataRecord/ Exception: Type= System.FormatException Message: Input string was not in a correct format.
StackTrace: at System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at StoreIrisFiles.Form1.ProcessDataRecord(clsCompany objSender, clsCompany objReceiver, String strRecord) in C:\VS.NET\MyProgs\01-VBcurrent\StoreIrisFiles\Form1.vb:line 553
Source:System.Data"

Command text and type are:

Me.cd_insertDataRecord.CommandText = "p_insertDataRecord"

Me.cd_insertDataRecord.CommandType = System.Data.CommandType.StoredProcedure
The connection is open explicitly.

Who could give me a hint regarding the cause of this exception?

Many thanks,

Dan

Nov 20 '05 #1
3 11725
This is probably something like a Date format which has got an integer in it or something. Basically its telling you that what you tried to insert in the database has data which does not correspond to the type of the field.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"dan" <de*@deamon.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl...
I am using VB.NET 2003 and SQL Server 2000.

The program uses ADO.NET .

The following instruction:

Me.cd_insertDataRecord.ExecuteNonQuery()
throws this exception:
">>>ProcessDataRecord/ Exception: Type= System.FormatException Message: Input string was not in a correct format.
StackTrace: at System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at StoreIrisFiles.Form1.ProcessDataRecord(clsCompany objSender, clsCompany objReceiver, String strRecord) in C:\VS.NET\MyProgs\01-VBcurrent\StoreIrisFiles\Form1.vb:line 553
Source:System.Data"

Command text and type are:

Me.cd_insertDataRecord.CommandText = "p_insertDataRecord"

Me.cd_insertDataRecord.CommandType = System.Data.CommandType.StoredProcedure
The connection is open explicitly.

Who could give me a hint regarding the cause of this exception?

Many thanks,

Dan

Nov 20 '05 #2
dan
That's what I thought.
However:
-all columns are char with one exception which is datetime
-I am printing the value of that parameter and the format is "mm/dd/yyyy"; in other situations that format has been accepted
-I also outcommented that parameter

On the other hand in conversion errors I usually get more explicit and specific messages such as "could not convert @parameter-name to smalldatetime" or something like that.
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message news:uM**************@TK2MSFTNGP09.phx.gbl...
This is probably something like a Date format which has got an integer in it or something. Basically its telling you that what you tried to insert in the database has data which does not correspond to the type of the field.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"dan" <de*@deamon.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl...
I am using VB.NET 2003 and SQL Server 2000.

The program uses ADO.NET .

The following instruction:

Me.cd_insertDataRecord.ExecuteNonQuery()
throws this exception:
">>>ProcessDataRecord/ Exception: Type= System.FormatException Message: Input string was not in a correct format.
StackTrace: at System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at StoreIrisFiles.Form1.ProcessDataRecord(clsCompany objSender, clsCompany objReceiver, String strRecord) in C:\VS.NET\MyProgs\01-VBcurrent\StoreIrisFiles\Form1.vb:line 553
Source:System.Data"

Command text and type are:

Me.cd_insertDataRecord.CommandText = "p_insertDataRecord"

Me.cd_insertDataRecord.CommandType = System.Data.CommandType.StoredProcedure
The connection is open explicitly.

Who could give me a hint regarding the cause of this exception?

Many thanks,

Dan

Nov 20 '05 #3
TRY SWAPPING THE DATE FORMAT TO US

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"dan" <de*@deamon.com> wrote in message news:e6**************@TK2MSFTNGP11.phx.gbl...
That's what I thought.
However:
-all columns are char with one exception which is datetime
-I am printing the value of that parameter and the format is "mm/dd/yyyy"; in other situations that format has been accepted
-I also outcommented that parameter

On the other hand in conversion errors I usually get more explicit and specific messages such as "could not convert @parameter-name to smalldatetime" or something like that.
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message news:uM**************@TK2MSFTNGP09.phx.gbl...
This is probably something like a Date format which has got an integer in it or something. Basically its telling you that what you tried to insert in the database has data which does not correspond to the type of the field.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"dan" <de*@deamon.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl...
I am using VB.NET 2003 and SQL Server 2000.

The program uses ADO.NET .

The following instruction:

Me.cd_insertDataRecord.ExecuteNonQuery()
throws this exception:
">>>ProcessDataRecord/ Exception: Type= System.FormatException Message: Input string was not in a correct format.
StackTrace: at System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at StoreIrisFiles.Form1.ProcessDataRecord(clsCompany objSender, clsCompany objReceiver, String strRecord) in C:\VS.NET\MyProgs\01-VBcurrent\StoreIrisFiles\Form1.vb:line 553
Source:System.Data"

Command text and type are:

Me.cd_insertDataRecord.CommandText = "p_insertDataRecord"

Me.cd_insertDataRecord.CommandType = System.Data.CommandType.StoredProcedure
The connection is open explicitly.

Who could give me a hint regarding the cause of this exception?

Many thanks,

Dan

Nov 20 '05 #4

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

Similar topics

11
by: Nobody | last post by:
Heres the deal... I have an application where I have a list (as in a Windows list control, but thats not important) displayed to the user. I sort this list based on the list controls sort function...
0
by: Punisher | last post by:
Ok I'm trying to reference a specific node in a tree. TreeNode nodeParentChannel = treeview1.Nodes; It bugs out with this error: Input string was not in a correct format Obviously 1.2 is not...
1
by: The Crow | last post by:
if the reason for error is simple, excuse me. but i cant find what the reason is. Here is the snippet : string script = String.Format(@"<script src='common.js'...
0
by: phmyhn | last post by:
I have two web pages, one is viewlarger.aspx, another one is shoppingcart.aspx. On the viewlarger.aspx, when clicking "add to cart" image button, the sub appends the id (passed from another page...
1
by: John Chorlton | last post by:
I've been attempting to pass a chunk of data back from a child Windows form using public properties on the form and have been getting some odd errors. I wanted to return a row of data to avoid...
9
by: rocio | last post by:
How can I format a string like this: 12924.999999999999 to print 12,925 ?
13
by: Jen | last post by:
One user of my application is experiencing an exception "input string not in correct format". But it makes no sense where it is occurring. It is occurring when a string from a textbox ("172") is...
6
by: =?Utf-8?B?SmVmZg==?= | last post by:
I thought this would already be covered here, but my search turned up nothing. In VS2005, if I use "String" to define a new variable/class, it colors it in the Aqua color as it does other...
2
by: babakandme | last post by:
Hi to every body...:D I'm a novice C++ programmer & I've a question, How can I write a class as follow to a file... Class A { public: // Accessors Methods...
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
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?
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
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
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.