Hi Guys,
I have been working on this for the past few hours but cant seem to get it right..
I have a web service..and i plan to use the dynamic array for array declaration
I have a struct like below
And below is my code to loop through data reader.
The problem is that i dont know how to create a dynamic array and keep appending the array size as the record goes in.
I dont want to execute a separate query to get the count(*), as it will take extra time, and i feel its good if we can change the size of array dynamically..
thank you very much for any help..
I have been working on this for the past few hours but cant seem to get it right..
I have a web service..and i plan to use the dynamic array for array declaration
I have a struct like below
Code:
public struct CAnalysisField
{
public double id;
public string name;
public string fullname;
public string description;
}
And below is my code to loop through data reader.
Code:
public RuleDbDataTypes.CAnalysisField[] processAnalysesNames()
{
RuleDbDataTypes.CAnalysisField[] AnalysisNames=null;int i=0;
OracleConnection con = databaseLogon(x,x,x);
OracleDataReader reader = processORA(con,constructSQL(ConfigurationSettings.AppSettings["getAnalysesNames"]));
//AnalysisNames = new RuleDbDataTypes.CAnalysisField[]; // find way to create dynamic array
while (reader.Read())
{
AnalysisNames[i].id = reader.GetDouble(0);
AnalysisNames[i].name = reader.GetString(1);
AnalysisNames[i].fullname = reader.GetString(2);
AnalysisNames[i].description = reader.GetString(3);
i++;
}
databaseLogout(con);
return AnalysisNames;
}
The problem is that i dont know how to create a dynamic array and keep appending the array size as the record goes in.
I dont want to execute a separate query to get the count(*), as it will take extra time, and i feel its good if we can change the size of array dynamically..
thank you very much for any help..