|
 |
aspx_beginners thread: Checking if a public property has been set
Message #1 by "Jon Maz" <jonmaz@s...> on Wed, 10 Apr 2002 23:51:11
|
|
Hi,
I'm building a business object ("Public Class Database") with a public
property "DataSet". What is the syntax for checking if the property
Database.DataSet has been set or not in an instance of this class? I
thought it might be something like:
If IsNothing (Database.DataSet)
but that doesn't work, and I haven't found anything looking through the
SDK documentation either.
I get two error messages when I try and compile Database.vb (via the
command line, no funds for VS.Net!):
Database.vb<40> : error BC30451 : Name 'IsNothing' is not declared
pointing to the "IsNothing" in "If IsNothing (Database.DataSet)"
and
Database.vb<40> : error BC30469 : Reference to a non-shared member
requires an object reference
pointing to the "Database.DataSet" in "If IsNothing
(Database.DataSet)"
Hope someone can help,
Thanks,
JON
+++++++++++
Database.vb
+++++++++++
Imports System
Imports System.Data
Imports System.Data.OleDb
Namespace BusinessObjects
Public Class Database
public DataSet as DataSet
etc etc
public function CreateDataTableDefaultView(DataTableName as
String, strQuery as string) as DataView
If IsNothing (Database.DataSet) 'PRODUCES ERRORS ABOVE
Message #2 by Colin.Montgomery@C... on Thu, 11 Apr 2002 10:33:44 +0100
|
|
Jon,
This is way over my head, but isn't 'Database' a reserved word? (I've just
had to fix an Access DB for a colleague because they had set the project
name, filename AND main table name to 'Database'.)
It'd be a miracle if i'm right, but...
HTH,
Col
-----Original Message-----
From: Jon Maz [mailto:jonmaz@s...]
Sent: 11 April 2002 00:51
To: aspx_beginners
Subject: [aspx_beginners] Checking if a public property has been set
Hi,
I'm building a business object ("Public Class Database") with a public
property "DataSet". What is the syntax for checking if the property
Database.DataSet has been set or not in an instance of this class? I
thought it might be something like:
If IsNothing (Database.DataSet)
but that doesn't work, and I haven't found anything looking through the
SDK documentation either.
I get two error messages when I try and compile Database.vb (via the
command line, no funds for VS.Net!):
Database.vb<40> : error BC30451 : Name 'IsNothing' is not declared
pointing to the "IsNothing" in "If IsNothing (Database.DataSet)"
and
Database.vb<40> : error BC30469 : Reference to a non-shared member
requires an object reference
pointing to the "Database.DataSet" in "If IsNothing
(Database.DataSet)"
Hope someone can help,
Thanks,
JON
+++++++++++
Database.vb
+++++++++++
Imports System
Imports System.Data
Imports System.Data.OleDb
Namespace BusinessObjects
Public Class Database
public DataSet as DataSet
etc etc
public function CreateDataTableDefaultView(DataTableName as
String, strQuery as string) as DataView
If IsNothing (Database.DataSet) 'PRODUCES ERRORS ABOVE
*******
This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the
intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are
not the intended recipient you must not copy this message or attachment or disclose the contents to any other person.
For further information about Clifford Chance please see our website at http://www.cliffordchance.com or refer to any Clifford
Chance office.
Message #3 by "Jon Maz" <jonmaz@s...> on Thu, 11 Apr 2002 16:57:27
|
|
Hi Col,
My code is an adaptation of code from ch 15 of "SAMS ASP.NET in 21 days",
where they liberally use 'Database' as shown and it all compiles just fine
and dandy.
Of course, the moment I tried to extend the code to do what I want, all
hell broke loose and nothing worked (hence this mail) - but whatever I'm
doing wrong, I'm pretty sure it isn't using a reserved word!
JON
|
|
 |