473,727 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

referencing properties of objects wthin object Collections

What is the syntax for referencing the properties of
objects within Collections of objects?

EXAMPLE:

Dim MCoil As New Coil
MCoil = CoilCollection( "3456")
TextBox1.Text() = MCoil.CoilDesc

WANT TO BE ABLE TO AVOID INTERMEDIARY COPY (SOEMTHING
LIKE):

TextBox1.Text() = CoilCollection( "3456").CoilDes c

Thanks,
Terry
Nov 20 '05 #1
2 1157
Hi,

TextBox1.Text() = DirectCast(Coil Collection("345 6"),Coil).CoilD esc

Ken
------------
"Terry" <no*****@mail.c om> wrote in message
news:24******** *************** ******@phx.gbl:
What is the syntax for referencing the properties of
objects within Collections of objects?

EXAMPLE:

Dim MCoil As New Coil
MCoil = CoilCollection( "3456")
TextBox1.Text() = MCoil.CoilDesc

WANT TO BE ABLE TO AVOID INTERMEDIARY COPY (SOEMTHING
LIKE):

TextBox1.Text() = CoilCollection( "3456").CoilDes c

Thanks,
Terry


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.6 - Release Date: 6/25/2004
Nov 20 '05 #2
Since you mention Collections of Objects, so I am assuming you are not using a
strongly typed collection.
I am also assuming that your problem is that the Object returned, does not know
about the CoilDesc property.
In this case, you seem fairly certain that the returned Object will be of type
Coil, so I would recommend a DirectCast.
TextBox1.Text = DirectCast(Coil Collection("345 6"), Coil).CoilDesc

In a nutshell, it is doing the same thing you were doing before, but just in 1
line and a little quicker.
(note, I didn't test the above, so please forgive any typo's)

Gerald

"Terry" <no*****@mail.c om> wrote in message
news:24******** *************** ******@phx.gbl. ..
What is the syntax for referencing the properties of
objects within Collections of objects?

EXAMPLE:

Dim MCoil As New Coil
MCoil = CoilCollection( "3456")
TextBox1.Text() = MCoil.CoilDesc

WANT TO BE ABLE TO AVOID INTERMEDIARY COPY (SOEMTHING
LIKE):

TextBox1.Text() = CoilCollection( "3456").CoilDes c

Thanks,
Terry

Nov 20 '05 #3

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

Similar topics

11
1791
by: thechaosengine | last post by:
Hi all, I have a very general but quite significant question about objects. My question is, when should I create them? I know thats a crap question so let me explain a bit further. Lets take an example of user management against a database. Things I might like to do include:
9
12426
by: kj | last post by:
Is there any way to programmatically discover and inspect *all* the properties of an object, even those that are not enumerable through a for/in loop? Thanks! kj -- NOTE: In my address everything before the period is backwards.
5
2211
by: Jason Butera | last post by:
I know that I can read/write custom properties of an object by using the following: Setting: document.all.customProp = "this"; Getting: document.all.customProp; Is there a way I can run code when this custom property is set. Or perhaps there is a way to create a custom method?
3
3028
by: ytrewq | last post by:
Should dynamic ("expando") properties be restricted to native and user-defined objects? Or should host objects - such as references to the browser or a plug-in or to the document and its elements - also allow them? Adding (and removing) object properties dynamically is an acceptable and common practice in JavaScript, and greatly adds to the power and character of the language. Essentially, an object in JavaScript can be considered to...
1
1133
by: Manny Silva | last post by:
Hi, I'm trying to create a simple managed C++ application that will be a test UI around a couple of ATL COM DLL projects that I have created (all with VS2003). What I am attempting to do is bring all three projects into the same solution and use them together. Now, to the managed project that serves as the test UI, I added project references to the other two ATL projects. The IDE accepted that just fine and the properties of the...
4
1041
by: Nick Wouters | last post by:
Please Help, I am a starting ASP.NET programmer... I have created a class user.vb and compiled it to dll I can fill the records from this database into the properties and collections. My problem is I want to transfer all the information in this object to another aspx-page... How can I do this?
2
1724
by: Miky | last post by:
Hi, I'm looking resources or tutorial where I can learn how to add properties to other objects at design time for VB.NEt or C#. I want to reproduce the same effect as when your drop the tooltip object on a form. Once it's done, every object has a new property added to the property box so we can write the tooltip text. Syncfusion object does something like that when we drop a docking
5
1576
by: Simon | last post by:
Hi all, We have an ASP.NET 1.1 application running on IIS6 on Server 2003. Most of the base objects we are using in this application are taken from a windows application also written by us. We have used shared properties on some of these objects to enable caching of frequently used objects, so save fetching them from SQL every time. These shared properties vastly increase performance of our windows app.
5
1497
by: Rich | last post by:
In VB6 I used to be able to add an object like a textbox and see the dropdown properties of that textbox from the collection object: Dim col as collection set col = new collection col.Add(txt1) col(0).Text = "test" This is not happening in VB.Net. Is there a way to use a collection object
0
9259
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...
0
9120
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6702
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
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4521
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
4785
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3228
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
2639
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.