aspose file tools*
The moose likes Beginning Java and the fly likes Creating an array to store variable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Creating an array to store variable" Watch "Creating an array to store variable" New topic
Author

Creating an array to store variable

Nico Yukiko
Greenhorn

Joined: Aug 24, 2005
Posts: 21
How to create an array that can store variable.I try to create the code below but it is giving me an error "object reference not set to an instance on an object "

Dim Info As String
Dim arrInfo() As String

For k = 0 To totalRows - 1
Info = lobjDs.Tables("tblMemberApproval").Rows(k).Item("strUserId")
arrInfo(k) = Info
Next
A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 979
Hi,

whats the language that u r using..???
Nico Yukiko
Greenhorn

Joined: Aug 24, 2005
Posts: 21
Actually this is a asp.net language.i am converting it into a java language.Can u help?
A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 979
Hi,

Make some modification to this one...


String Info=null;
String arrInfo[]=new String[specify the size];

for(int k=0;condition;k++) {
Info=new String(get the column value of the record from the recordset..);
arrIngo[k]=Info;
}

Regards
 
Don't get me started about those stupid light bulbs.
 
subject: Creating an array to store variable