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

declaration expected

Hi All,

I have a page which I want to accept an ID on the querystring - I'm trying
to get this ID into a hidden form field.

I have the following code at the top of my page:

Line 5: <script language="VB" runat="server">
Line 6: dim ResortID as integer
Line 7: ResortID = Request.QueryString("resortid")
Line 8: </script>

I get this error:

Compiler Error Message: BC30188: Declaration expected.

What have I done wrong?

I hear alot of talk about using code behind page for everything, but how
would I grab querystring vars using code behind?

Regards,
Simon.
Nov 18 '05 #1
2 5303
i prefer to directly use
Requst("variablename") to grab the variable.

if you double click the page it should open the codebehind class file on
Page_Load event handler.

here declare something like

dim ResortID as integer

if Request("resortid") <> "" then
ResortID = cint(Request("resortid"))
end if

i dont use VB.NET so dont know if you have cint any more.
In C# we tend to use int.parse(string) to get int convesion. you can also
use Convert.ToInt32(variable) to get a int

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Simon Harris" <to***********@makes-you-fat.com> wrote in message
news:e1**************@TK2MSFTNGP12.phx.gbl...
Hi All,

I have a page which I want to accept an ID on the querystring - I'm trying
to get this ID into a hidden form field.

I have the following code at the top of my page:

Line 5: <script language="VB" runat="server">
Line 6: dim ResortID as integer
Line 7: ResortID = Request.QueryString("resortid")
Line 8: </script>

I get this error:

Compiler Error Message: BC30188: Declaration expected.

What have I done wrong?

I hear alot of talk about using code behind page for everything, but how
would I grab querystring vars using code behind?

Regards,
Simon.

Nov 18 '05 #2
Thank you! Now working, and in the code behind as it 'should be'

"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:un*************@TK2MSFTNGP14.phx.gbl...
i prefer to directly use
Requst("variablename") to grab the variable.

if you double click the page it should open the codebehind class file on
Page_Load event handler.

here declare something like

dim ResortID as integer

if Request("resortid") <> "" then
ResortID = cint(Request("resortid"))
end if

i dont use VB.NET so dont know if you have cint any more.
In C# we tend to use int.parse(string) to get int convesion. you can also
use Convert.ToInt32(variable) to get a int

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Simon Harris" <to***********@makes-you-fat.com> wrote in message
news:e1**************@TK2MSFTNGP12.phx.gbl...
Hi All,

I have a page which I want to accept an ID on the querystring - I'm
trying
to get this ID into a hidden form field.

I have the following code at the top of my page:

Line 5: <script language="VB" runat="server">
Line 6: dim ResortID as integer
Line 7: ResortID = Request.QueryString("resortid")
Line 8: </script>

I get this error:

Compiler Error Message: BC30188: Declaration expected.

What have I done wrong?

I hear alot of talk about using code behind page for everything, but how
would I grab querystring vars using code behind?

Regards,
Simon.


Nov 18 '05 #3

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

Similar topics

83
by: Alexander Zatvornitskiy | last post by:
Hello All! I'am novice in python, and I find one very bad thing (from my point of view) in language. There is no keyword or syntax to declare variable, like 'var' in Pascal, or special syntax in...
1
by: Ammar_ace | last post by:
Can Somebbody pls help me out here. i am new to .net programming, i am trying to connect to an access database and read, but i get the error message 'BC30188 Declaration Expected' this is what i...
9
by: D. Shane Fowlkes | last post by:
Still learning ASP.NET....(and I was getting so good with classic ASP too!). I'm trying to connect to a SQL Server using a simple connection script. I've checked 2 different books and looked at...
2
by: Simon Harris | last post by:
Hi All, I'm trying to the the following code working in VS.Net, when I add the lines noted with '<<<<<' VS tells me declaration is expected for 'SPDOleDbConnection' Public Class DBConnect...
3
by: gamehack | last post by:
Hi all, Here's the error which I'm getting when trying to compile some code: boxmanager.h:16: error: ISO C++ forbids declaration of 'vector' with no type boxmanager.h:16: error: expected...
1
by: INeedADip | last post by:
What is the difference between: function setupGrid( param ){......} and setupGrid = function( param ){......} Are there any advantages to doing one over the other?
7
by: Florian Haag | last post by:
Hello, I'm trying to compile a programme which compiles fine under Linux; I'm trying it with MinGW G++ 3.4.2: Component.h: #ifndef COMPONENT_H_ #define COMPONENT_H_
8
by: aneuryzma | last post by:
Hello, I'm merging an OpenCV app with an Ogre3d app. I'm on a mac, I'm using xCode. When I add #include "openCVApp.h" I got the following error:
6
by: samsneelam | last post by:
Hi.. This is samuel, while doing a program, i encountered this problem.. Let me give you clarity regarding my prob.. I am having two files .. one is mpcplib.h it contains the follwing...
1
by: shekhardotnet | last post by:
below testing code gives an error "declaration expected" please suggest Imports System.Data.SqlClient Public Class Form1 Inherits System.Windows.Forms.Form 'Create ADO.NET objects....
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
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
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.