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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

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

public function Getgrouplist( ) as Collection.

You should try it!

Po$$e
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
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.