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.
3 1016
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
Hi,
this is my code. -
strQUERY = "SELECT PARAMETER_INDEX,SITE FROM SYS_PARAMS ORDER BY PARAMETER_INDEX"
-
If CON.State = ConnectionState.Closed Then
-
CON.Open()
-
End If
-
da = New SqlDataAdapter(strQUERY, CON)
-
Dim ds1 As New DataSet
-
da.Fill(ds1)
-
reccount = ds1.Tables(0).Rows.Count
-
mvarTOTAL_PARAMETERS = reccount
-
Dim x As Integer
-
For x = 0 To mvarTOTAL_PARAMETERS
-
ReDim Preserve muiparamCHANNEL_ARRAY(x)
-
muiparamCHANNEL_ARRAY(x) = New CHANNEL------(class)
-
-
-
-
-------à (the above step is go to the channel class ,default values retrived)
-
-
Next x
-
-
For Each r In ds1.Tables(0).Rows
-
intPARAM_INDEX = r.Item("PARAMETER_INDEX")
-
If intPARAM_INDEX <= mvarTOTAL_PARAMETERS Then
-
muiparamCHANNEL_ARRAY(intPARAM_INDEX).PARAMETER_INDEX = r.Item("PARAMETER_INDEX")
-
muiparamCHANNEL_ARRAY(intPARAM_INDEX).SITE = r.Item("site")
-
-
muiparamCHANNEL_ARRAY(intPARAM_INDEX).IO_OBJECT = mvarINPUT_OUTPUT
-
muiparamCHANNEL_ARRAY(intPARAM_INDEX).DB_RETRIEVE()
-
-
-
----à 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
-
-
-
End If
-
Next
-
“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---------------------- -
-
strQUERY = "SELECT PARAMETER_INDEX, PARAMETER_NAME, " & _
-
"PARAMETER_UNITS, SITE FROM " & _
-
"SYS_PARAMS ORDER BY PARAMETER_INDEX"
-
Set recSYS_CONFIG = dbSYS_CONFIG.OpenRecordset(strQUERY)
-
If recSYS_CONFIG.RecordCount > 0 Then
-
recSYS_CONFIG.MoveLast
-
recSYS_CONFIG.MoveFirst
-
Do While Not recSYS_CONFIG.EOF
-
intINDEX = recSYS_CONFIG!PARAMETER_INDEX
-
If intINDEX <= mvarTOTAL_PARAMETERS Then
-
muiparamCHANNEL_ARRAY(intINDEX).SYSTEM_DB_NAME = _
-
mvarSYSTEM1_DB_NAME
-
muiparamCHANNEL_ARRAY(intINDEX).PARAMETER_NAME = _
-
recSYS_CONFIG!PARAMETER_NAME
-
muiparamCHANNEL_ARRAY(intINDEX).PARAMETER_UNITS = _
-
recSYS_CONFIG!PARAMETER_UNITS
-
muiparamCHANNEL_ARRAY(intINDEX).SITE = recSYS_CONFIG!SITE
-
Set muiparamCHANNEL_ARRAY(intINDEX).IO_OBJECT = mvarINPUT_OUTPUT
-
muiparamCHANNEL_ARRAY(intINDEX).DB_RETRIEVE
-
End If
-
recSYS_CONFIG.MoveNext
-
Loop
-
End If
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
Sign in to post your reply or Sign up for a free account.
Similar topics
by: pvinodhkumar |
last post by:
The number of elemets of the array, the array bound must be constant
expression?Why is this restriction?
Vinodh
|
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...
|
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...
|
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.
|
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 =...
|
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...
|
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...
|
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
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
| |