473,395 Members | 1,629 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,395 software developers and data experts.

"name not declared" but it is

TJS
it says the name is not declared, but it is
how can I fix this ?

Compiler Error Message: BC30451: Name 'arrReportsList' is not declared.
==========================
if Len(request.querystring("rpt")) > 0 then
Dim arrReportsList =split(request.querystring("rpt"),",")
else
Dim arrReportsList =split(Session("rpt"),",")
end if

vPagecount = Ubound(arrReportsList) + 1 '<== error on this line
Nov 18 '05 #1
2 2631
the reason is that you are defining a variable local to that block
ie the variable arrReportList is local to your if or else block

try something like this
Dim arrReportList (not sure how you do it in VB but in c# you would do it
this way string[] arrReportList
if Len(request.querystring("rpt")) > 0 then
arrReportsList =split(request.querystring("rpt"),",")
else
Dim arrReportsList =split(Session("rpt"),",")
end if

vPagecount = Ubound(arrReportsList) + 1 '<== error on this line

Should be fine now... hth

--
Regards,
HD
Once a Geek.... Always a Geek
"TJS" <no****@here.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
it says the name is not declared, but it is
how can I fix this ?

Compiler Error Message: BC30451: Name 'arrReportsList' is not declared.
==========================
if Len(request.querystring("rpt")) > 0 then
Dim arrReportsList =split(request.querystring("rpt"),",")
else
Dim arrReportsList =split(Session("rpt"),",")
end if

vPagecount = Ubound(arrReportsList) + 1 '<== error on this line

Nov 18 '05 #2
You have to declare the type.

Dim arrReportsList as string()

I would declare it before the if statement and then set it in the if
statement

arrReportsList = split(request.querystring("rpt"),",")

"TJS" <no****@here.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
it says the name is not declared, but it is
how can I fix this ?

Compiler Error Message: BC30451: Name 'arrReportsList' is not declared.
==========================
if Len(request.querystring("rpt")) > 0 then
Dim arrReportsList =split(request.querystring("rpt"),",")
else
Dim arrReportsList =split(Session("rpt"),",")
end if

vPagecount = Ubound(arrReportsList) + 1 '<== error on this line

Nov 18 '05 #3

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

Similar topics

0
by: DC Gringo | last post by:
I'm getting a "BC30451: Name 'CRListType' is not declared." error Here's the top of the page where I'm getting stuck... <%@ Control Language="vb" AutoEventWireup="false"...
3
by: Alfred E Neuman | last post by:
I've read that... AClass ac = AClass( "name", 23 ); is less efficient than... AClass ac( "name", 23 ); because the first has to create a temporary object which is then assigned to ac. ...
0
by: ReignMan | last post by:
I'm running JDK 1.4.0_01, Xalan2.5.1 and Tomcat 4.1.27. XSL transformations work, yet when running in debug mode (Eclipse IDE), I get the following: 990S2html.xsl:3:80: Element type...
4
by: Dan Jacobson | last post by:
Using <A name="x_y-z"></A>, I even get nervous about the _ and -. w3-recs/RECS/html4/struct/links.html seems to say all of ascii is cool and beyond. Anyway, just what is the safe range for...
10
by: ST | last post by:
Hi, I'm new to vb.net programming, and I keep getting this error: Name 'GetQuery' is not declared. I can't figure out why?? It seems like I have the right references/namespaces. This is my code...
2
by: fabrice | last post by:
Hello I'm getting an error during a .vb file compilation. My command is : vbc /t:library /r:system.web.dll /r:system.dll /r:mscorlib.dll myFile.vb The error is :
5
by: Kevin R | last post by:
I'm trying to update a sql database. It's modified Oledb code from an example that did work with an access database. How can I tweak my code to make it work? Thanks in advance. Kevin...
3
by: JohnJohn | last post by:
Hello. I have an aspx page called MyAspx.aspx (for the sake of this discussion) and its associated code file, MyAspx.aspx.vb. In the .vb file, I have declared a variable as follows: Public...
2
by: Monty | last post by:
Hello, I have a label control in my master page like this: <asp:Label ID=lblStatusMessage runat="server"></asp:Label> When I reference the control in my code-behind I get this error "Name...
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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.