473,465 Members | 1,489 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to create 2 dimensional dynamic array (vb.net or c#)

I've tryed to something lik this and got "Object reference not set to
an instance of an object."

Dim myarr(,) As String
myarr(0, 0) = "aaaa"
myarr(0, 1) = "bbbb"
myarr(1, 0) = "cccc"
myarr(1, 1) = "dddd"
Thanks.

Apr 6 '07 #1
2 6326

Try:

Dim myArr(,) As String

ReDim myArr (1, 1)
<si*****@gmail.comwrote in message
news:11*********************@y66g2000hsf.googlegro ups.com...
I've tryed to something lik this and got "Object reference not set to
an instance of an object."

Dim myarr(,) As String
myarr(0, 0) = "aaaa"
myarr(0, 1) = "bbbb"
myarr(1, 0) = "cccc"
myarr(1, 1) = "dddd"
Thanks.

Apr 6 '07 #2
On Apr 6, 3:43 pm, "Duracel" <nos...@itsarealshame.comwrote:
Try:

Dim myArr(,) As String

ReDim myArr (1, 1)

<sing...@gmail.comwrote in message

news:11*********************@y66g2000hsf.googlegro ups.com...
I've tryed to something lik this and got "Object reference not set to
an instance of an object."
Dim myarr(,) As String
myarr(0, 0) = "aaaa"
myarr(0, 1) = "bbbb"
myarr(1, 0) = "cccc"
myarr(1, 1) = "dddd"
Thanks.- Hide quoted text -

- Show quoted text -
The problem I dont know how long will be this array, I cant define its
size.
I guess it cant be done with arrays, is there some control or type
that will do this job ?

Apr 6 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Nick | last post by:
Loop to create an array from a dynamic form. I'm having trouble with an application, and I'll try to explain it as clearly as possible: 1. I have a form with two fields, say Apples and...
11
by: fivelitermustang | last post by:
Actually, how would I go about allocating a four-dimensional dynamic array? I only know how to make two dimensional dynamic arrays: double **v; v = new double*; for (int i=0; i<C; i++) { v =...
10
by: BCC | last post by:
Ive been googling and reading through my books but I haven't figured out a solution (much less an elegant one) to create a multidimensional array with a runtime determined number of dimensions. I...
5
by: poojithareddy | last post by:
Hai, I am trying to pass a 2 dimensional array to a function and I am having a problem with this. If the array was a Static 2D array, the code would be somethinlike this void...
4
by: Bill Sun | last post by:
Hi, All I have a conventional question, How to create a 3 dimension array by C language. I see some declare like this: int *** array; int value; array = create3Darray(m,n,l);
60
by: Peter Olcott | last post by:
I need to know how to get the solution mentioned below to work. The solution is from gbayles Jan 29 2001, 12:50 pm, link is provided below: >...
4
by: singleb | last post by:
I've tryed to something lik this and got "Object reference not set to an instance of an object." Dim myarr(,) As String myarr(0, 0) = "aaaa" myarr(0, 1) = "bbbb" myarr(1, 0) = "cccc" myarr(1,...
2
by: =?Utf-8?B?SHVzYW0=?= | last post by:
Hi EveryBody: I am using vb.net 2005 and the following code trying to create varible at runtime: For n=1 to 4 dim v+n.tostring(n) as double Next n the resone behaind using the previous...
4
by: Sunny | last post by:
Hi, Is there a way in javascript to create Dynamic arrays or arrays on fly. Something Like: var "ptsgN"+sd = new Array(); Here sd is incrementing by 1. I have lots of data that I am...
1
by: ict027 | last post by:
i wanted to create a two dimensional dynamic array in vs.net . but it gives errors, this is the syntax i tried; Dim arrDen(,) As Integer(numOfEmp, nDen) i hope your suggestions to create...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.