Return dataset into an array?

I have a class called GroupDALC
iN THAT i HAVE A FUNCTION CALLED - pUBLIC FUNCTION gETGROUPLIST( ) AS ARRAY.
This method retrieves the grouplist information available in the qsr database and returns them in a dataset to the caller order by groupID field.

This has a stored procedure called psp_getgrouplist.

I don't know how to assign a dataset into an array and hoewto group it?
hemalatha_sakthivelAsked:
Who is Participating?
 
possekeCommented:
I'm not sure what you want, but why would you want to convert a perfectly structured dataset into an array?
You should better change the return type of your method to dataset. Below is your code the way I feel how it should be in your situation.
If i'm mistaken here, please correct me!

Public Class GroupDALC

                 Public Function GetGroupList( )as DATASET
                        '
                        'Code for sqlconnection string.
                        'Code for Sqlcommandtext(Where the stored procedure goes here.,as psp_gETgrouplist)
                        GroupDALCdataset = sqlhelper.Executedataset(sqlconnectionstring,commandtype.storedprocedure,sqlcommandtext)
                        '
                        Return GroupDALCdataset
                        '
                 End Function
End Class

with a dataset as return type, all the data will be accessible too, and you'll have a lot more power to control it too than if you were to use an array!!

Hope this is what you want?

Po$$e
0
 
possekeCommented:
You can use a collection object, which can store allmost anything, going from strings to datasets

Po$$e
0
 
possekeCommented:
That would mean your function has to return another type:

public function Getgrouplist( ) as Collection.

You should try it!

Po$$e
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
hemalatha_sakthivelAuthor Commented:
Hi Posseke

Thanks for your response.. But i AM NOT CLEAR ABOUT THAT. hERE IS MUY CODE.,

Public Class GroupDALC

Public Function GetGroupList( )as array
'Code for sqlconnection string.
'Code for Sqlcommandtext(Where the stored procedure goes here.,as psp_gETgrouplist)
'GroupDALCdataset = sqlhelper.Executedataset(sqlconnectionstring,commandtype.storedprocedure,sqlcommandtext)

'Return dataset(Here only I have to know how to transform the dats in data set to array format)
End Function
End Class

OR IS THERE ANY OTHER WAY TO WRITE THIS CODE?

Please help me out.

Thanks

HHHH
0
 
hemalatha_sakthivelAuthor Commented:
Hey Thanks for your suggestion.

But the thing is I want to return as ARRAY only bcoz this function is by another function which also returns as array.
And My boss told to try using  INMEMORY ARRAYLIST to get the data from the dataset into the array.

So any Idea of using that InmemoryArraylist.

Let me know

I appreciate your help.

Thanks a lot Po$$e
0
 
possekeCommented:
Hi,

In reply to hemelatha's last question I don't know the answer so I stick with my final suggestion...

Greets,

Po$$e
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.