.NETGURU
GetRows arrays in VB.NET
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngmigrate' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Johnson, Peter
I'm taking an incremental approach to migrating an ASP app to ASP.NET, still
using classic ADO in my ASP.NET pages for now.

My VBScript ASP code creates a variable myArray (with the code "Dim
myArray() As String"), opens a recordset, then returns Recordset.GetRows
into myArray. After converting the page to VB.NET, this works fine without
Option Strict, but when I turn it on, I get this:

Compiler Error Message: BC30512: Option Strict disallows implicit
conversions from System.Array to 1-dimensional Array of String.

Source Error:
Line 192:myArray = CType(rstOfficeList.GetRows(), Array)

Source Line: 192

As you can see, the last thing I've tried is using CType to convert it into
an Array, with no success. I've also tried:

- @ Page aspcompat="true" which changes nothing
- myArray = rstOfficeList.GetRows() which gives me a similar error--"...from
System.Object to 1-dimensional Array of String"
- Dim myArray As Array compiles past the GetRows line, then bombs when I try
to access the array's values

Any help would be much appreciated. GetRows was a great idea in classic ASP
but it's a pain to migrate!

--Peter

----------------------------------------------------------------------------

This e-mail and any attachments may be confidential or legally privileged.
If you received this message in error or are not the intended recipient, you
should destroy the e-mail message and any attachments or copies, and you are
prohibited from retaining, distributing, disclosing or using any information
contained herein. Please inform us of the erroneous delivery by return
e-mail.

Thank you for your cooperation.

----------------------------------------------------------------------------

Reply to this message...
 
    
Phil Winstanley (VIP)
Peter might be worth reading this

<carroll>
Getrows is now basically built-in so that EVERYONE is doing it by default
and achieves high scalability.

See my writeup @ http://www.learnasp.com/freebook/learn/datasets.aspx
about how dataviews and datasets replace the recordset.
</carroll>

Plip.

--
Phil Winstanley.
Creations Group Limited
Web : http://www.creations-group.com
Mail : Click here to reveal e-mail address

Definition: XP

eXperience Phil.
--

-----Original Message-----
From: Johnson, Peter [mailto:Click here to reveal e-mail address]
Sent: 19 December 2001 20:24
To: aspngmigrate
Subject: [aspngmigrate] GetRows arrays in VB.NET

I'm taking an incremental approach to migrating an ASP app to ASP.NET, still
using classic ADO in my ASP.NET pages for now.

My VBScript ASP code creates a variable myArray (with the code "Dim
myArray() As String"), opens a recordset, then returns Recordset.GetRows
into myArray. After converting the page to VB.NET, this works fine without
Option Strict, but when I turn it on, I get this:

Compiler Error Message: BC30512: Option Strict disallows implicit
conversions from System.Array to 1-dimensional Array of String.

Source Error:
Line 192:myArray = CType(rstOfficeList.GetRows(), Array)

Source Line: 192

As you can see, the last thing I've tried is using CType to convert it into
an Array, with no success. I've also tried:

- @ Page aspcompat="true" which changes nothing
- myArray = rstOfficeList.GetRows() which gives me a similar error--"...from
System.Object to 1-dimensional Array of String"
- Dim myArray As Array compiles past the GetRows line, then bombs when I try
to access the array's values

Any help would be much appreciated. GetRows was a great idea in classic ASP
but it's a pain to migrate!

--Peter

----------------------------------------------------------------------------

This e-mail and any attachments may be confidential or legally privileged.
If you received this message in error or are not the intended recipient, you
should destroy the e-mail message and any attachments or copies, and you are
prohibited from retaining, distributing, disclosing or using any information
contained herein. Please inform us of the erroneous delivery by return
e-mail.

Thank you for your cooperation.

----------------------------------------------------------------------------

| [aspngmigrate] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngmigrate.asp = JOIN/QUIT

********************
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify
Click here to reveal e-mail address, and delete it from your systems.
You should not copy, disclose, or distribute its contents to anyone without
our written permission.
Creations Group emails are scanned for viruses but cannot be guaranteed to
be virus-free. We accept no liability for viruses which may inadvertently be
transmitted, nor for any loss occasioned by them.
This e-mail and any files enclosed remain the property of Creations Group
Limited.

Reply to this message...
 
    
Johnson, Peter
Thanks, Phil. I'd love to use DataSets and data binding, etc. but
unfortunately the quickest route for migrating this is keeping all the
classic ADO objects. This particular function takes an existing
ADODB.Connection anyway, plus I've got GetRows all over the code so if I can
spend a few hours figuring it out once, then that would make the others go
quicker.

Hope that makes sense. I'm thinking the quickest way is to make GetRows
work, or just get rid of it and loop through the ADODB.Recordset object.

--Peter

[Original message clipped]

----------------------------------------------------------------------------

This e-mail and any attachments may be confidential or legally privileged.
If you received this message in error or are not the intended recipient, you
should destroy the e-mail message and any attachments or copies, and you are
prohibited from retaining, distributing, disclosing or using any information
contained herein. Please inform us of the erroneous delivery by return
e-mail.

Thank you for your cooperation.

----------------------------------------------------------------------------

Reply to this message...
 
    
Brian Bilbro (VIP)
Doesn't apply. Peter is talking about ADO not ADO.NET.

--
Brian

----- Original Message -----
From: "Phil Winstanley" <Click here to reveal e-mail address>
Sent: 12/19/2001 3:34 PM

[Original message clipped]

Reply to this message...
 
 
System.Array
System.Object




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification