Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Return dataset into an array?

Posted on 2006-03-28
9
Medium Priority
?
290 Views
Last Modified: 2010-04-23
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?
0
Comment
Question by:hemalatha_sakthivel
  • 4
  • 2
6 Comments
 
LVL 2

Expert Comment

by:posseke
ID: 16318723
You can use a collection object, which can store allmost anything, going from strings to datasets

Po$$e
0
 
LVL 2

Expert Comment

by:posseke
ID: 16318729
That would mean your function has to return another type:

public function Getgrouplist( ) as Collection.

You should try it!

Po$$e
0
 

Author Comment

by:hemalatha_sakthivel
ID: 16327359
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 2

Accepted Solution

by:
posseke earned 2000 total points
ID: 16329882
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
 

Author Comment

by:hemalatha_sakthivel
ID: 16337586
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
 
LVL 2

Expert Comment

by:posseke
ID: 16532947
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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month21 days, 5 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question