🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.database.dotnet
Article #3

Input string was not in a correct format

#3
From: Brigitte Spatz
Date: Wed, 08 Nov 2006 13:49
31 lines
2408 bytes
   dr := dv.Item[bm.Position].Row; {dv = Dataview, bm = BindingManager}
   dv.AllowNew := True;
   for i := 0 to Length(arrComp) - 1 do {arrComp = array of Integer}
   begin
     bm.AddNew;
     dv.Item[bm.Position].Row.ItemArray := dr.ItemArray;
     for j := 1 to Length(dr.ItemArray) - 1 do //exclude ID
       if j <> 13 then //exclude foreign key column
         dv.Item[bm.Position].Row.Item[j] := dr.Item[j];
     bm.EndCurrentEdit;
     db.write_changes_ins(da, ds, true, 'ODM', sqlInsertCommand1); {this 
is basically an Update command}

So I have read out an existing record - the dr. Then I have assigned 
(almost) every attribute of that record to a new record in the same 
table. One would think that this should work without problems (the ID 
comes from a stored procedure in the sqlInsertCommand1 and works fine). 
However, the table has five VarChar columns, three of which don't accept 
the values passed to them - one gives "string was not recognized as a 
valid Boolean", the other two "Input string was not in a correct 
format." None of the date, integer, bit and text columns are affected, 
it's only those three varchar columns. I understand that the first would 
occur if a string was passed to a bit column and the second if a string 
was passed to an integer column but they're all varchar(75)! If I copy a 
record that has no entry in any of these three columns all is well.

Any ideas?

TIA.

Brigitte
Technical Details
Message-ID: <4551e051@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 1effe6,baf13c6032d70442,start
X-Google-Attributes: gid1effe6,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Wed, 08 Nov 2006 14:49:03 +0100
From: Brigitte Spatz <brigitteNOSPAM.spatz@svenmahn.de>
Organization: Sven Mahn IT-Systementwicklungen
User-Agent: Thunderbird 1.5.0.7 (Windows/20060909)
MIME-Version: 1.0
Newsgroups: borland.public.delphi.database.dotnet
Subject: Input string was not in a correct format
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Antivirus: avast! (VPS 0646-2, 07/11/2006), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 217.189.160.135
Message-ID: <4551e051@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1162993745 217.189.160.135 (8 Nov 2006 05:49:05 -0700)
Lines: 31
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail