🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: DataTable.NewRow

#132
From: Wayne Niddery [TeamB]
Date: Wed, 04 Oct 2006 14:01
22 lines
1781 bytes
Eric Orilla wrote:
> row['id'] := 1; <**** Incompatible types: 'Object' and 'Integer'
> row['ic'] := 123.456; <**** Incompatible types: 'Object' and 'Double'

> What is the rigth way of doing this...


Just cast them (called boxing in this case because it's wrapping value types 
into objects):

row['id'] := TObject(1);
row['ic'] := TObject(123.456);

Alternatively, add {$AUTOBOX ON} to the unit and the compiler will do the 
boxing for you.

-- 
Wayne Niddery - Winwright, Inc (www.winwright.ca)
"If there is any principle of the Constitution that more imperatively
calls for attachment than any other, it is the principle of free
thought � not free thought for those who agree with us, but freedom for
the thought that we hate." - Oliver Wendell Holmes 
Technical Details
Message-ID: <4523beb4$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.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
References: <45236f21@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1effe6,20afc7b05fc3bcdc
X-Google-Attributes: gid1effe6,public
X-Google-Language: ENGLISH,ASCII
Reply-To: "Wayne Niddery [TeamB]" <wniddery@chaffaci.on.ca>
From: "Wayne Niddery [TeamB]" <wniddery@chaffaci.on.ca>
Newsgroups: borland.public.delphi.database.dotnet
References: <45236f21@newsgroups.borland.com>
Subject: Re: DataTable.NewRow
Date: Wed, 4 Oct 2006 10:01:24 -0400
Lines: 24
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 69.17.150.141
Message-ID: <4523beb4$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1159970484 69.17.150.141 (4 Oct 2006 07:01:24 -0700)
X-Authenticated-User: wniddery
Path: arc1-ca.pugleaf.net!g2news2.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