Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating an array to store variable

 
Nico Yukiko
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

whats the language that u r using..???
 
Nico Yukiko
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually this is a asp.net language.i am converting it into a java language.Can u help?
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic