473,401 Members | 2,127 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,401 software developers and data experts.

''SqlDataReader not define" error

I want to Declear a variable as SqlDataReader in ASP 2.0. But when i do so it
tells me SqlDataReader is not define. This same code works in my previous
application in ASP 1.0. Has this change? Can someone show me how to do this.
Below is the function and the line of the error is bold.

Function GetUniversity() As String
Dim Unipayment As New UnipaymentDB
Dim CIDR As SqlDataReader =
Unipayment.StudentState(Request.Params("StudentID" ))

'Intilize university name depending on courseID
GetUniversity = ""
If CIDR.Read Then
If CIDR("CourseID") = "CMS" Or CIDR("CouresID") =
"DMS" Or CIDR("CourseID") = "MBA" Then
GetUniversity = "University of Leicester"
Else
GetUniversity = "London Metropolitan
University"
End If
CIDR.close()
End If
End Function

Jan 24 '06 #1
4 1295
are you referencing and importing System.Data.SqlClient?

Karl

--
http://www.openmymind.net/

"paapa21" <pa*****@discussions.microsoft.com> wrote in message
news:C8**********************************@microsof t.com...
I want to Declear a variable as SqlDataReader in ASP 2.0. But when i do so
it
tells me SqlDataReader is not define. This same code works in my previous
application in ASP 1.0. Has this change? Can someone show me how to do
this.
Below is the function and the line of the error is bold.

Function GetUniversity() As String
Dim Unipayment As New UnipaymentDB
Dim CIDR As SqlDataReader =
Unipayment.StudentState(Request.Params("StudentID" ))

'Intilize university name depending on courseID
GetUniversity = ""
If CIDR.Read Then
If CIDR("CourseID") = "CMS" Or CIDR("CouresID") =
"DMS" Or CIDR("CourseID") = "MBA" Then
GetUniversity = "University of Leicester"
Else
GetUniversity = "London Metropolitan
University"
End If
CIDR.close()
End If
End Function

Jan 24 '06 #2
yes i'm referencing it and i do have system.data.sqlclient in the page-behind
code in the app_code folder where unipaymentdb is still not work.

i tried Dim CIDR As System.Data.SqlClient.SqlDataReader =
Unipayment.StudentState(Request.Params("StudentID" )) which worked. But don't
know why the previous doen't
"Karl Seguin [MVP]" wrote:
are you referencing and importing System.Data.SqlClient?

Karl

--
http://www.openmymind.net/

"paapa21" <pa*****@discussions.microsoft.com> wrote in message
news:C8**********************************@microsof t.com...
I want to Declear a variable as SqlDataReader in ASP 2.0. But when i do so
it
tells me SqlDataReader is not define. This same code works in my previous
application in ASP 1.0. Has this change? Can someone show me how to do
this.
Below is the function and the line of the error is bold.

Function GetUniversity() As String
Dim Unipayment As New UnipaymentDB
Dim CIDR As SqlDataReader =
Unipayment.StudentState(Request.Params("StudentID" ))

'Intilize university name depending on courseID
GetUniversity = ""
If CIDR.Read Then
If CIDR("CourseID") = "CMS" Or CIDR("CouresID") =
"DMS" Or CIDR("CourseID") = "MBA" Then
GetUniversity = "University of Leicester"
Else
GetUniversity = "London Metropolitan
University"
End If
CIDR.close()
End If
End Function


Jan 24 '06 #3
well, atleast you got it working. I'm not sure what the issue is either. I'd
still guess it's just a syntax error somewhere..

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"paapa21" <pa*****@discussions.microsoft.com> wrote in message
news:7B**********************************@microsof t.com...
yes i'm referencing it and i do have system.data.sqlclient in the
page-behind
code in the app_code folder where unipaymentdb is still not work.

i tried Dim CIDR As System.Data.SqlClient.SqlDataReader =
Unipayment.StudentState(Request.Params("StudentID" )) which worked. But
don't
know why the previous doen't
"Karl Seguin [MVP]" wrote:
are you referencing and importing System.Data.SqlClient?

Karl

--
http://www.openmymind.net/

"paapa21" <pa*****@discussions.microsoft.com> wrote in message
news:C8**********************************@microsof t.com...
>I want to Declear a variable as SqlDataReader in ASP 2.0. But when i do
>so
>it
> tells me SqlDataReader is not define. This same code works in my
> previous
> application in ASP 1.0. Has this change? Can someone show me how to do
> this.
> Below is the function and the line of the error is bold.
>
> Function GetUniversity() As String
> Dim Unipayment As New UnipaymentDB
> Dim CIDR As SqlDataReader =
> Unipayment.StudentState(Request.Params("StudentID" ))
>
> 'Intilize university name depending on courseID
> GetUniversity = ""
> If CIDR.Read Then
> If CIDR("CourseID") = "CMS" Or CIDR("CouresID")
> =
> "DMS" Or CIDR("CourseID") = "MBA" Then
> GetUniversity = "University of Leicester"
> Else
> GetUniversity = "London Metropolitan
> University"
> End If
> CIDR.close()
> End If
> End Function
>


Jan 24 '06 #4
Thank Karl. I review the code to check for syntax error.

"Karl Seguin [MVP]" wrote:
well, atleast you got it working. I'm not sure what the issue is either. I'd
still guess it's just a syntax error somewhere..

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"paapa21" <pa*****@discussions.microsoft.com> wrote in message
news:7B**********************************@microsof t.com...
yes i'm referencing it and i do have system.data.sqlclient in the
page-behind
code in the app_code folder where unipaymentdb is still not work.

i tried Dim CIDR As System.Data.SqlClient.SqlDataReader =
Unipayment.StudentState(Request.Params("StudentID" )) which worked. But
don't
know why the previous doen't
"Karl Seguin [MVP]" wrote:
are you referencing and importing System.Data.SqlClient?

Karl

--
http://www.openmymind.net/

"paapa21" <pa*****@discussions.microsoft.com> wrote in message
news:C8**********************************@microsof t.com...
>I want to Declear a variable as SqlDataReader in ASP 2.0. But when i do
>so
>it
> tells me SqlDataReader is not define. This same code works in my
> previous
> application in ASP 1.0. Has this change? Can someone show me how to do
> this.
> Below is the function and the line of the error is bold.
>
> Function GetUniversity() As String
> Dim Unipayment As New UnipaymentDB
> Dim CIDR As SqlDataReader =
> Unipayment.StudentState(Request.Params("StudentID" ))
>
> 'Intilize university name depending on courseID
> GetUniversity = ""
> If CIDR.Read Then
> If CIDR("CourseID") = "CMS" Or CIDR("CouresID")
> =
> "DMS" Or CIDR("CourseID") = "MBA" Then
> GetUniversity = "University of Leicester"
> Else
> GetUniversity = "London Metropolitan
> University"
> End If
> CIDR.close()
> End If
> End Function
>


Jan 25 '06 #5

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

Similar topics

2
by: Al | last post by:
Hi, I am getting "Application-defined or object-define error" when trying to instantiate an MTS component. However, when I run the VB source-code and leave it in run-time, I am able to...
3
by: Ricola ! | last post by:
Why do I say: SqlDataReader dr; instead of SqlDataReader dr = new SqlDataReader();
2
by: Cameron Frasnelly | last post by:
I emulated the code from the .Net Framework help (Titled "Using Stored Procedures with a Command") and I still receive and error... Error Received = "Invalid attempt to read when no data is...
3
by: ElanKathir | last post by:
Hi All ! How to create the User Define Error Object and how to Genrate the Error (How to through the Error?) in VB.NET ? Please Reply ASAP. Thanks & Regards, ElanKathir.S.N, ASM...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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
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...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.