Article View: borland.public.csharpbuilder.language.csharp
Article #22Boxing and unboxing
From: Andre
Date: Fri, 05 May 2006 20:09
Date: Fri, 05 May 2006 20:09
40 lines
2289 bytes
2289 bytes
Are there any preformance issues (good or bad) regarding the boxing and
unboxing of class type objects?
Are the following code segement a succesful passing and returning of a ds
refrence and not its value?
Please comment on the following code:
The mission is to fill a Dataset in DAL by using a DataSet object
instantiated by BLL assembly.
( i havn;t tested this code. it's in theory correct...i think)
BLL assembly:
public void addTestTable()
{
//NOTE: the DataSet ds has a table already defined during design time.
an additional table (testTable) must be added to the
//DataSet ds. For preformance optimization I want to use the refrence of
the exiting DataSet ds and not a copy thereof.
//How feasible is this approach? Is it worth the hype? And will this
work?
DAL.FillWithData( "SELECT * FROM testTable" , (object)ds
,"myTestTable");
if (ds.Tables["myTestTable"] != null) MessageBox.Show("Refrencing
Success");
}
DAL assmebly:
public void FillWithData(string _sql, object _datasource, string _tablename)
{
//assuming all connections are made and commandtext set.
DataSet ds = (DataSet)_datasource;
mysqlAdapter.Fill(ds, _tablename);
}
Technical Details
Message-ID:
<445bb0fa@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!news2.arglkargh.de!news.ispa.de!newsfeed.freenet.de!news.code-werk.net!open-news-network.org!news.soft-gems.net!reader.uucp.at!newsfeed.uucp.at!news.uucp.at!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,17b83a1499eb2170,start X-Google-Attributes: gid1efe35,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Andre" <andretruter@webmail.co.za> Newsgroups: borland.public.csharpbuilder.language.csharp Subject: Boxing and unboxing Date: Fri, 5 May 2006 22:09:35 +0200 Lines: 42 Organization: Bluewater Systems X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original X-Antivirus: avast! (VPS 0618-3, 05/05/2006), Outbound message X-Antivirus-Status: Clean NNTP-Posting-Host: 196.207.45.253 Message-ID: <445bb0fa@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1146859770 196.207.45.253 (5 May 2006 13:09:30 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!news2.arglkargh.de!news.ispa.de!newsfeed.freenet.de!news.code-werk.net!open-news-network.org!news.soft-gems.net!reader.uucp.at!newsfeed.uucp.at!news.uucp.at!newsgroups.borland.com!not-for-mail