By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,558 Members | 1,673 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,558 IT Pros & Developers. It's quick & easy.

cast problem

P: n/a
Sam
Hi,
I can't figure out which cast I should do (using DirectCast) to solve
this one :

Dim aRow1 As Array
dtData.Rows(nRow2).ItemArray = aRow1

Option Strict On disallows implicit conversions from 'System.Array' to
'1-dimensional array of System.Object'.
Thx

Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Two choices: -

1. Use DirectCast(aRow1, Object())
2. Declare aRow1 directly as an array of objects e.g. Dim aRow1() as Object

Usually, you use the Array class directly only if you need to call one of
the shared methods (e.g. Sort, IndexOf) or if the array type is unknown
until runtime.

Hope this helps,

Nick Hall
"Sam" <sa**************@voila.fr> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,
I can't figure out which cast I should do (using DirectCast) to solve
this one :

Dim aRow1 As Array
dtData.Rows(nRow2).ItemArray = aRow1

Option Strict On disallows implicit conversions from 'System.Array' to
'1-dimensional array of System.Object'.
Thx

Nov 21 '05 #2

P: n/a
Sam
thanks a lot !

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.