Groups | Blog | Home
all groups > sql server (microsoft) > february 2006 >

sql server (microsoft) : Indentity field + update statement = error?


tomdesmet NO[at]SPAM gmail.com
2/22/2006 12:30:13 PM
Hi,

I have a website programmed in ASP.Net (VB.Net) where I use an SQL
UPDATE statement saying something like this:

UPDATE table1 SET blabla = 'hola' WHERE id = 11

The error returned is: Input string was not in a correct format.

Seems like a normal easy error to solve, but it just won't work. If I
remove the "WHERE id = 11" from the statement, the update statement
works fine, but of course changes every row in my table.
Now I think it's maybe due to the reason that the id field is set as
identity with seed 1 and increment 1.

Does anyone know how to solve this problem? Running the profiler
doesn't give me any feedback because it doesn't send the SQL statement
through it seems to the Database, I THINK. So maybe it doesn't involve
the identity column. The problem is, my other code seems good cause I
use the ID's everywhere, INSERT, DELETE, SELECT, etc. And those don't
give any troubles.

I hope somebody can give me a hint, because i'm going nuts here.


TDS
Jens
2/22/2006 11:11:45 PM
Thats valid SQL you posted below, please post us the code snipplet of
your ASP page. I think there is an error not in the pure sql.

HTH, jens Suessmeyer.
Madhivanan
2/24/2006 5:57:06 AM
Also post the table structure

Madhivanan
AddThis Social Bookmark Button