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

Dynamically Creating Objects

P: n/a
I know I've asked this before, but I didn't really get an answer and I
bet it's because I didn't explain myself very well. Here goes again.

I have this code:

Dim arrData(intNoOfRows, intNoOfColumns) As Object

Dim intR As Integer

For intC As Integer = 0 To intNoOfColumns - 1
arrData(intR, intC) = ds.Tables(0).Columns.Item
(intC).ColumnName

For intR = 0 To intNoOfRows - 1
arrData(intR, intC) =
ds.Tables(0).Rows(intR).Item(intC)
Next
Next
What I want to do instead is:

Dynamically create the required amount of arrData objects, by
incrementing them by one. i.e. pseudo code:

Dim arrData(inX)(intNoOfRows, intNoOfColumns) As Object

Where intX will be the incrementation that will give me the following
type output:

arrData1
arrData2...etc.

Any Ideas?

Thanks
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Chris,

In my opinion do you not want to dynamicly creating objects, however
creating mnemonics at run time.

However what is the difference between your wish and this.

Dim arrData(inXNoOf tables, intNoOfRows, intNoOfColumns) As Object

arrData(1)
arrData(2)...etc.

In my opinion are you now creating dynamicly objects in runtime.
When I would show it with an arraylist in a sample you would see that the
reference to the object is added.

Cor
Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.