473,670 Members | 2,550 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

help with creating a 'nickname' or 'alias'

Hi:

I am not sure what the code would be to achieve this.

I am looking for a way to give an alias to an object, so I can assign values
to the object regardless of the name.

What is the way to make an object which is just a shortcut to another
object, so when I am referring to the shortcut, it is really altering the
original object?

something like a myAlias but I am not sure how to declare it

If something then
myAlias = dataGRID1
elseif something else
myAlias = dataGRID2
else
myAlias = dataGRID3
end if

<ADO functions to create dataset as oDS>

myAlias.DataSou rce = oDS
myAlias.Databin d()

I want to not have to write the ADO functions three times. I need to
determine the datagrid up front, and not after the ADO functions for logical
reasons within the code.

VB .NET or C# example would be fine. Hopefully VB .NET given the newsgroup
:)

Thanks!
Nov 21 '05 #1
2 3466
If your problem is as simple as I'm think it is, just do this:

Dim myAlias as DataGrid
If something then
myAlias = dataGRID1
elseif something else
myAlias = dataGRID2
else
myAlias = dataGRID3
end if

myAlias.DataSou rce = oDS
myAlias.Databin d()

Notice how I don't use "new" to declare the variable. I'm not creating an
object, just a reference point to other objects.

Hope it helps
Chris

"Tarren" <no***********@ thanks.com> wrote in message
news:%2******** **********@TK2M SFTNGP09.phx.gb l...
Hi:

I am not sure what the code would be to achieve this.

I am looking for a way to give an alias to an object, so I can assign
values to the object regardless of the name.

What is the way to make an object which is just a shortcut to another
object, so when I am referring to the shortcut, it is really altering the
original object?

something like a myAlias but I am not sure how to declare it

If something then
myAlias = dataGRID1
elseif something else
myAlias = dataGRID2
else
myAlias = dataGRID3
end if

<ADO functions to create dataset as oDS>

myAlias.DataSou rce = oDS
myAlias.Databin d()

I want to not have to write the ADO functions three times. I need to
determine the datagrid up front, and not after the ADO functions for
logical reasons within the code.

VB .NET or C# example would be fine. Hopefully VB .NET given the newsgroup
:)

Thanks!

Nov 21 '05 #2
Thanks! Works perfectly. :)
"Chris, Master of All Things Insignificant" <chris@No_Spam_ Please.com> wrote
in message news:OV******** ********@TK2MSF TNGP11.phx.gbl. ..
If your problem is as simple as I'm think it is, just do this:

Dim myAlias as DataGrid
If something then
myAlias = dataGRID1
elseif something else
myAlias = dataGRID2
else
myAlias = dataGRID3
end if

myAlias.DataSou rce = oDS
myAlias.Databin d()

Notice how I don't use "new" to declare the variable. I'm not creating an
object, just a reference point to other objects.

Hope it helps
Chris

"Tarren" <no***********@ thanks.com> wrote in message
news:%2******** **********@TK2M SFTNGP09.phx.gb l...
Hi:

I am not sure what the code would be to achieve this.

I am looking for a way to give an alias to an object, so I can assign
values to the object regardless of the name.

What is the way to make an object which is just a shortcut to another
object, so when I am referring to the shortcut, it is really altering the
original object?

something like a myAlias but I am not sure how to declare it

If something then
myAlias = dataGRID1
elseif something else
myAlias = dataGRID2
else
myAlias = dataGRID3
end if

<ADO functions to create dataset as oDS>

myAlias.DataSou rce = oDS
myAlias.Databin d()

I want to not have to write the ADO functions three times. I need to
determine the datagrid up front, and not after the ADO functions for
logical reasons within the code.

VB .NET or C# example would be fine. Hopefully VB .NET given the
newsgroup :)

Thanks!


Nov 21 '05 #3

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

Similar topics

1
1084
by: Robert | last post by:
Hello, I'm trying to build a website, with profiles of different people. But if it al more than 1000 people, i want to search for profiles, to keap it easy. BUT I Don't know how to build one.. It goes about this script:
8
3610
by: db2sysc | last post by:
We have defined a NICKNAME to go to Mainframe table and when do a SELECT * FROM NICKNAME from a version 8 client we get SQL0101N error. The same select from V7 client works fine. The SELECT returns 5 rows. From IBM support site, http://www-1.ibm.com/support/search.wss?q=SQL0101N&tc=SSEPGG&rs=71 I could see two problems opened for V8 namely JR19670 and
2
12879
by: Guru | last post by:
Hi All Can someone explain what is the difference between Alias and Nickname? Warm Regards Guru
22
2044
by: Dave Cooke | last post by:
Hi I am very new to C. I am trying to figure out how to initialize a struct in my main program. The struct is declared in anouther header file like this... typedef struct ln { int key; int data; struct ln *next; } listNode, *listNodePtr; just to test in my main method I tried to initialize the
5
15796
by: Jiggaz | last post by:
Hi, Look my stored procedure : __________________ ALTER PROCEDURE dbo.CreateAccount @Nickname varchar(30), @Password varchar(15), @Email varchar(50), @Date datetime,
1
4340
by: treelife | last post by:
I'm getting and internal server error when | run the following mod_python script. I am actually trying to run Django. Script: from mod_python import apache def handler(req): req.content_type = 'text/plain' req.write("Under Construction")
3
7647
by: Jean-Marc Blaise | last post by:
Hi, Is there any reason why a CREATE NICKNAME statement fails if the remote object is an ALIAS ? I actually have an ALIAS that is used to point to the correct table in the remote DB, and would like the nickname to point to this alias, avoiding the obligation to drop and recreate the nickname any time. Thanks for your help,
1
3941
by: Gerhard | last post by:
How can I create a new contact in exchange server from a vb.net web application?
0
5558
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
0
8471
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
8903
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...
1
8592
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,...
0
8661
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...
0
7421
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5686
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();...
1
2802
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
2044
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1795
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.