Search:
Namespaces
Discussions
.NET v1.1
Feedback
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
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com