473,377 Members | 1,153 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,377 software developers and data experts.

retreive array

I have a function written in vb 6 which returns an array of results within a
collection.
In asp i get the array with this type of code

arList = objGetRecords("cdrecords")

I generated wsdl file for this function using soap toolkit and the dll. Then
added web reference to asp.net(c#) project and instantiated the function.
How do I retrieve the array of results here in c#? Any idea? Sample code
would be nice.

Thanks,

Reddy
Nov 15 '05 #1
2 2289
Srinivasa,

If you could post the code for the objGetRecords method, then that would
help. Most likely, it is returning an object, or an array cast to an
object. Are the types all simple types?
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Srinivasa Reddy K Ganji" <gk******@adsgroup.com> wrote in message
news:u0**************@tk2msftngp13.phx.gbl...
I have a function written in vb 6 which returns an array of results within a collection.
In asp i get the array with this type of code

arList = objGetRecords("cdrecords")

I generated wsdl file for this function using soap toolkit and the dll. Then added web reference to asp.net(c#) project and instantiated the function.
How do I retrieve the array of results here in c#? Any idea? Sample code
would be nice.

Thanks,

Reddy

Nov 15 '05 #2
Hi Nicholas,

This was the function in the VB active x dll project

Public Function GetCDRecords() As Variant

Dim colResponse As New Collection
Dim arList As Variant

On Error GoTo GetCDRecordsErrHandler

Set objDB = New ADODB.Connection
Set objRs = New ADODB.Recordset
objDB.Open strConn

strSql = "select cdm.cdno, cdm.cdtitle, cdcategory = (select cdcatname from
cdcategories cdc where cdc.cdid = cdm.cdid) from cdmaster cdm where
cdm.Status = 1 order by 1 desc"
objRs.Open strSql, strConn, adOpenKeyset, adLockReadOnly
If Not (objRs.BOF And objRs.EOF) Then
arList = objRs.GetRows()
End If
objRs.Close

colResponse.Add arList, "CDRecords"
colResponse.Add False, Key:="error"
Set GetCDRecords = colResponse

Set objRs = Nothing
objDB.Close
Set objDB = Nothing
Exit Function

GetCDRecordsErrHandler:
Set objRs = Nothing
objDB.Close
Set objDB = Nothing
GetCDRecords = "ERROR: " & Err.description
End Function

In ths ASP I used to get the array as follows,

Set objCDs = Server.CreateObject("capitalCD.admin")
Set objCDCatalog = objCDs.GetCDRecords()
arList = objCDCatalog("CDRecords")

I wanted to make this function accessible via a web service.

Thanks,

Reddy

"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> wrote
in message news:Og**************@TK2MSFTNGP12.phx.gbl...
Srinivasa,

If you could post the code for the objGetRecords method, then that would help. Most likely, it is returning an object, or an array cast to an
object. Are the types all simple types?
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Srinivasa Reddy K Ganji" <gk******@adsgroup.com> wrote in message
news:u0**************@tk2msftngp13.phx.gbl...
I have a function written in vb 6 which returns an array of results within
a
collection.
In asp i get the array with this type of code

arList = objGetRecords("cdrecords")

I generated wsdl file for this function using soap toolkit and the dll.

Then
added web reference to asp.net(c#) project and instantiated the

function. How do I retrieve the array of results here in c#? Any idea? Sample code
would be nice.

Thanks,

Reddy


Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Lee | last post by:
Hello, This is a genral enquiry before I send out a more detailed request. I am unable to retreive image files from a mysql database using IE 5.2 on the mac OS X platform. I have built a...
3
by: Not4u | last post by:
I would like to know which products are my best sells by sellers, but i would like to retreive this info by product id, seller id and the total amount of sells for this product. My Sells table...
2
by: conraba | last post by:
I am creating a modal dialog box in ASP.NET via client-side javascript and passing vArguments parameters in an array form using this syntax: vReturnValue = window.showModalDialog(sURL ) ...
1
by: Jean Christophe Avard | last post by:
Hi! I have a dataset where I have a field that is a image. I can't figure out how to retreive the imahe, I get the invalid paranmeter with this code... Try Dim buffer() As Byte =...
1
by: Sudhakara.T.P. | last post by:
Hi, I have an application in VB.NET windows application, wherein the administrator has the option to change the authentication mode ie., whether the application should work as a normal database...
3
by: Goran Djuranovic | last post by:
Hi All, Does anyone know how to retreive deepest XPath value from XML document by using VB.NET? For example, if I had an XML file like this: <Root> <Customer> <Name>MyName</Name> </Customer>...
0
by: Goran Djuranovic | last post by:
Hi All, Does anyone know how to retreive deepest XPath value from XML document by using VB.NET? For example, if I had an XML file like this: <Root> <Customer> <Name>MyName</Name> </Customer>...
10
by: craig.keightley | last post by:
I am trying to get the next row within a loop for a script i am developing... I need to display a final table row within the table that i have displayed on the page, but i only want to show it...
4
by: AkMaLiTo | last post by:
hi... i am in a mess, i need to use visual basic 6 with sql server 2000 database.. could someone tell me the best component to use with sql ? the project is as follow: retreive table names in a...
1
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...
0
isladogs
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.