Article View: borland.public.delphi.database.dotnet
Article #4Re: Input string was not in a correct format
From: Brigitte Spatz
Date: Wed, 08 Nov 2006 14:55
Date: Wed, 08 Nov 2006 14:55
36 lines
2808 bytes
2808 bytes
Brigitte Spatz wrote:
> 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;
Please discard the following line, it was just one of many attempts of
getting it to work but never used at the same time as the code following it:
> 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:
<4551efdb$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4551e051@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 1effe6,baf13c6032d70442 X-Google-Attributes: gid1effe6,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Wed, 08 Nov 2006 15:55:22 +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: Re: Input string was not in a correct format References: <4551e051@newsgroups.borland.com> In-Reply-To: <4551e051@newsgroups.borland.com> 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: <4551efdb$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1162997723 217.189.160.135 (8 Nov 2006 06:55:23 -0700) Lines: 36 Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail