473,382 Members | 1,615 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

array data storage problem

dim arr as array=array.createinstance(getype(channel),param_i ndex)

ARR(PARAM_INDEX)=NEW CHANNEL

HERE CHANNEL IS CLASSNAME

PARAM_INDEX IS COMING FROM DATABASE

problem occur in this situtation
redim presereve arr(param_index)

HOW TO DO THIS.
Aug 30 '08 #1
3 1016
Curtis Rutland
3,256 Expert 2GB
There's a few problems with this post. Please elaborate more on your question. It is very hard to understand. Please clearly state what you are trying to achieve and what problems you are having achieving it, not just asking how to do it.

You also need a more descriptive title. Titles are important, because they let the experts know what your thread is about. They may skip it if it isn't descriptive, and you won't get any help.

Third, please don't type in all-caps. On the internet that is the same as shouting and considered very rude.

Lastly, when posting code, it needs to be surrounded by [code] tags. You can use the # button on the text editor.

Please re-work your question properly and post it as a reply to this thread.

MODERATOR
Aug 30 '08 #2
Hi,

this is my code.
Expand|Select|Wrap|Line Numbers
  1. strQUERY = "SELECT PARAMETER_INDEX,SITE FROM SYS_PARAMS ORDER BY PARAMETER_INDEX"
  2.         If CON.State = ConnectionState.Closed Then
  3.             CON.Open()
  4.         End If
  5.         da = New SqlDataAdapter(strQUERY, CON)
  6.         Dim ds1 As New DataSet
  7.         da.Fill(ds1)
  8.         reccount = ds1.Tables(0).Rows.Count
  9.         mvarTOTAL_PARAMETERS = reccount
  10. Dim x As Integer
  11.         For x = 0 To mvarTOTAL_PARAMETERS
  12.             ReDim Preserve muiparamCHANNEL_ARRAY(x)
  13.             muiparamCHANNEL_ARRAY(x) = New CHANNEL------(class)
  14.  
  15.  
  16.  
  17. -------à    (the above step is go to the channel class ,default values retrived)
  18.  
  19.         Next x
  20.  
  21.         For Each r In ds1.Tables(0).Rows
  22.             intPARAM_INDEX = r.Item("PARAMETER_INDEX")
  23.             If intPARAM_INDEX <= mvarTOTAL_PARAMETERS Then
  24. muiparamCHANNEL_ARRAY(intPARAM_INDEX).PARAMETER_INDEX = r.Item("PARAMETER_INDEX")
  25.                 muiparamCHANNEL_ARRAY(intPARAM_INDEX).SITE = r.Item("site")
  26.  
  27.                 muiparamCHANNEL_ARRAY(intPARAM_INDEX).IO_OBJECT = mvarINPUT_OUTPUT
  28.                 muiparamCHANNEL_ARRAY(intPARAM_INDEX).DB_RETRIEVE()
  29.  
  30.  
  31. ----à   the above step is go to channel class and execute DB_RETRIEVE() store the values muiparamCHANNEL_ARRAY ,but each time replaced all the dimensions replaced
  32.  
  33.  
  34.             End If
  35. Next
  36.  
“After complte for loop muiparamCHANNEL_ARRAY is last retrived values all rows same displayed whats the problem ,can u suggestion for sol”



--------------Old vb code----------------------

Expand|Select|Wrap|Line Numbers
  1.  
  2. strQUERY = "SELECT PARAMETER_INDEX, PARAMETER_NAME, " & _
  3.                "PARAMETER_UNITS, SITE FROM " & _
  4.                "SYS_PARAMS ORDER BY PARAMETER_INDEX"
  5.     Set recSYS_CONFIG = dbSYS_CONFIG.OpenRecordset(strQUERY)
  6.     If recSYS_CONFIG.RecordCount > 0 Then
  7.       recSYS_CONFIG.MoveLast
  8.       recSYS_CONFIG.MoveFirst
  9.       Do While Not recSYS_CONFIG.EOF
  10.         intINDEX = recSYS_CONFIG!PARAMETER_INDEX
  11.         If intINDEX <= mvarTOTAL_PARAMETERS Then
  12.           muiparamCHANNEL_ARRAY(intINDEX).SYSTEM_DB_NAME = _
  13.             mvarSYSTEM1_DB_NAME
  14.           muiparamCHANNEL_ARRAY(intINDEX).PARAMETER_NAME = _
  15.             recSYS_CONFIG!PARAMETER_NAME
  16.           muiparamCHANNEL_ARRAY(intINDEX).PARAMETER_UNITS = _
  17.             recSYS_CONFIG!PARAMETER_UNITS
  18.           muiparamCHANNEL_ARRAY(intINDEX).SITE = recSYS_CONFIG!SITE
  19.           Set muiparamCHANNEL_ARRAY(intINDEX).IO_OBJECT = mvarINPUT_OUTPUT
  20.           muiparamCHANNEL_ARRAY(intINDEX).DB_RETRIEVE
  21.         End If
  22.         recSYS_CONFIG.MoveNext
  23.       Loop
  24.     End If
Aug 30 '08 #3
Curtis Rutland
3,256 Expert 2GB
Please read and follow moderator's instructions more carefully. I asked you to use code tags and to post your updated question as a reply to this thread, not to make a new one.

I have merged the threads and added code tags for you, but please read our Posting Guidelines carefully before you post again, and follow all our forum's rules.

MODERATOR
Aug 30 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: pvinodhkumar | last post by:
The number of elemets of the array, the array bound must be constant expression?Why is this restriction? Vinodh
4
by: Robert | last post by:
I am curious why some people feel that Javascript doesn't have associative arrays. I got these definitions of associative arrays via goggle: Arrays in which the indices may be numbers or...
8
by: Gerald | last post by:
I have a problem with an array of pointers. In a program I'm writing, I have to read a file, containing thousands of short lines. The content of another file will be compared against each line...
37
by: Carol Depore | last post by:
How do I determine the maximum array size? For example, int a works, but a does not (run time error). Thank you.
204
by: Alexei A. Frounze | last post by:
Hi all, I have a question regarding the gcc behavior (gcc version 3.3.4). On the following test program it emits a warning: #include <stdio.h> int aInt2 = {0,1,2,4,9,16}; int aInt3 =...
18
by: Sam | last post by:
Hi All I'm planing to write an application which allows users dynamically add their points (say you can add upto 30,000) and then draw xy graph. Should I use an array for my coordinate point...
3
by: David Mathog | last post by:
This one is driving me slightly batty. The code in question is buried deep in somebody else's massive package but it boils down to this, two pointers are declared, the first is: char **resname...
30
by: questions? | last post by:
say I have a structure which have an array inside. e.g. struct random_struct{ char name; int month; } if the array is not intialized by me, in a sense after I allocated a
19
by: Mark | last post by:
i need to make a class that can store anything (integers,objects,etc) it needs to maintain a list of pointers to these objects the list needs to be resized to accomodate more elements i can't use...
7
by: roguefeebo | last post by:
I'm very new to programming so be gentle, :( Essentially what I would like to do is to have a single function to be able to create a dynamic array of pointers to a struct so that I can have a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.