473,324 Members | 2,356 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,324 software developers and data experts.

Computed field in temp table causes error in .NET

I am getting "Input string was not in a correct format" error in a line
like this:
Int32.Parse(((DataRowView)e.Item.DataItem).Row.Ite mArray[8].ToString())

Field #8 comes from a SQL Server stored proc. The stored proc returns a
select statement from a temp table. The temp table was created by a select
into statement like this select .........., 0.5 * another column into #temp

What data type does #8 have in the framework when it's returned by ado.net?
Because when I use the debugger and have a watch on the object returned,
the object is a number however inside the watch window, it doesn't have a
curly braces nor double quotes around it so I am guessing it's not pure
number nor a string.

What format is the object in that's causing the above error?

TIA

John Dalberg
Feb 2 '06 #1
1 1236
select 0.5

will return a float. Int32.Parse() only supports a string. also even if you
convert to a string, Parse does not support decimal points. you can cast a
float to int. but if you are just trying to truncate:

Math.Floor((double)((DataRowView)e.Item.DataItem). Row.ItemArray[8])).ToString())

-- bruce (sqlwork.com)

"John Dalberg" <no****@nospam.sss> wrote in message
news:20*******************@newsreader.com...
I am getting "Input string was not in a correct format" error in a line
like this:
Int32.Parse(((DataRowView)e.Item.DataItem).Row.Ite mArray[8].ToString())

Field #8 comes from a SQL Server stored proc. The stored proc returns a
select statement from a temp table. The temp table was created by a select
into statement like this select .........., 0.5 * another column into
#temp

What data type does #8 have in the framework when it's returned by
ado.net?
Because when I use the debugger and have a watch on the object returned,
the object is a number however inside the watch window, it doesn't have a
curly braces nor double quotes around it so I am guessing it's not pure
number nor a string.

What format is the object in that's causing the above error?

TIA

John Dalberg

Feb 3 '06 #2

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

Similar topics

2
by: tperovic | last post by:
Using SS2K, I'm getting the following error while bulk inserting: Column 'warranty_expiration_date' cannot be modified because it is a computed column. Here is my bulk insert statement: ...
9
by: DMAC | last post by:
If i want to split a computed column into two or more columns based on the the length (its a varchar) of the computed column, how often will sql server determine what the computed column is?...
6
by: pb648174 | last post by:
I have a pivot table implementation, part of which is posted below. It returns no errors in query analyzer, but when profiler is run, it shows that "Error 208" is happening. I looked that up in BOL...
4
by: Henning N?rg?rd | last post by:
I'm working as software developer mostely om SQL-server platform. On SQL-server we are using a lot of "Computed Columns" Does anyone know if that is possible to do in DB2 too ? I mean - define...
2
by: Robert McEuen | last post by:
Using Access 97, Windows XP I'm receiving a Numeric Field Overflow error during text import that I did not receive before I split my database. Another thread I found suggested that the cause of...
4
by: Josh | last post by:
Hi, I am trying to write a function in a module in MS Access 2000 that will change the data type of a field called 'Start' in table 'bo_cpm_CS01ALL'. Here is the code that I have done so far...
5
by: rdemyan via AccessMonster.com | last post by:
I have a need to add another field to all of my tables (over 150). Not data, but an actual field. Can I code this somehow. So the code presumabley would loop through all the tables, open each...
7
by: Aamir Mahmood | last post by:
Hi All I have DataTable object. Is there a way that I can know which fields (columns) in the table are computed. Apparantly the DataTable.Columns returns all columns both computed and other....
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.