473,657 Members | 2,686 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Object and New (Basic)

Hi

See this,

Public Class Elan
Public variable as Interger
Public Sub Function1()
----------
------
End Sub

Public Sub Function1()
-----
--------
End Sub
End Class
I used this class in my Web page . Like

Dim Object1 as Elan

So it's gives Error

Dim Object1 as New Elan()

Here, What is the use of New ? , B'se I have no New Mothed in this Class.
----------------------------------------------------------------------------
----
and Why we use the Dataset Oject Like this

Dim objDataSet as DataSet

Why we not use the New Monthed here?
By,
Elankathir



Nov 18 '05 #1
2 1210
All reference types (classes) must be instantiated in order to be used.
This is why you couldn't use your class until you made a new instance of it.
Even if you don't explicitly create a constructor method ("New") for you
class, the CLR will create one for you in memory.

With other classes, you can use shared members, which means that you don't
have to have an instance of the class to use the member. The "show" method
of the MessageBox class is an example of this. You don't need to create an
instance of the MessageBox to use it.

With a DataSet (or any other class) you can DECLARE it:

Dim ds as DataSet

But you won't be able to do anything with it unless you create an instance
of it or set it equal to instance of another object.
"ElanKathir " <sn**********@h otmail.com> wrote in message
news:O3******** ******@TK2MSFTN GP11.phx.gbl...
Hi

See this,

Public Class Elan
Public variable as Interger
Public Sub Function1()
----------
------
End Sub

Public Sub Function1()
-----
--------
End Sub
End Class
I used this class in my Web page . Like

Dim Object1 as Elan

So it's gives Error

Dim Object1 as New Elan()

Here, What is the use of New ? , B'se I have no New Mothed in this Class.
-------------------------------------------------------------------------- -- ----
and Why we use the Dataset Oject Like this

Dim objDataSet as DataSet

Why we not use the New Monthed here?
By,
Elankathir


Nov 18 '05 #2

Hi Scott M.

Thanks for you Reply, I got this b'se of u. Thanks a lot..

Thanks & Regrads,
Elankathir
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3

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

Similar topics

2
5589
by: Marcel | last post by:
Hi, I'm using Microsoft Visual Basic .NET and want to reference the ThisApplication variable but cannot get to it or find the OfficeCodeBehind class. Is this a shortcomming of the fact that I have Microsoft Visual Basic and not Visual Studio .NET? On page: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_wrcore/html/wrgrfapplicationobject.asp I read:
11
9243
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in C++. I find my self sometimes, trying Object app = Object(); Object *app = Object(); Object app = new Object();
2
1706
by: Chris Asaipillai | last post by:
Hi there Im starting a new course this Saturday. OBJECT ORIENTED DEVELOPMENT WITH VISUAL BASIC .NET and will cover the following concepts and principles. a.. Be able to build VB.NET applications using custom object design. b.. Utilise existing .NET Framework objects and extending functionality. c.. Become familiar with how to utilise the IDE to help OOP.
6
13407
by: Scott M. Lyon | last post by:
As I mentioned in my other post, I'm attempting to, using COM Interop so I can update existing VB6 code to (for several specific functions) return a Hashtable from a .NET library. I've had very little luck processing the Hashtable itself in VB6 (I can add a reference to the project so it knows what a Hashtable is, but I'm not having much luck looping through all objects in the Hashtable), so I decided to try a different idea.
5
1804
by: Aussie Rules | last post by:
Hi, Having a mental block on this one. Have done it before but can't rack my brain on how... I have an object, with a bunch on property, and I add that object to a combo box. I want the property '.fulladdress' to be the value that appears in the drop downs text section. How to I set that parameter to be the one shown inthe drop down
3
2043
by: Simon Hart | last post by:
Hi, I am trying to implement some functionality as seen in MS CRM 3.0 whereby a basic Xml is deserialized into an object which contains properties. What I want to do from here is; cast the basic object into a more strongly typed class which knows what properties to expect. The basic top level class is as follows: using System;
4
1837
by: LyzH | last post by:
Someone else had a question on how to emulate a mouse click. I tried posting in that thread but I have something of a twist on this problem and I'm really in trouble here! If I don't get help soon, I'm going to fail this class and the class is already dragging down my GPA. I'm taking an introductory visual basic class with an advanced visual basic book and assignments (the department dropped the prerequisite and the class needs one....
7
13925
by: thersitz | last post by:
Hi, Very new to asp.net. Using VStudio 2005 on an XP Pro machine. Using Cassini to view. I see this error discussed all over the net but don't seem to find a way to resolve my particular grief -- which I am sure is not unique. Here are my basic steps: 1) create a masterpage -- add some simple graphics to the header.
10
1892
by: abhash | last post by:
I am bit puzzled at the following piece of code I tried: ---------------------------------------------------------------------------------- #include <iostream> using namespace std; class Test { public: Test() { cout<<"Cons\n";} Test(Test& a) { cout<<"Copy cons\n";}
9
1650
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I am just starting to write some code in C#. One time I accidently used "object" instead of "Object". The program didn't complain at all and worked fine. I am just wondering is there any difference between object and Object in C#? thanks --
0
8407
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8837
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8739
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8512
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6175
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2739
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.