473,396 Members | 1,799 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,396 software developers and data experts.

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.DataSource = oDS
myAlias.Databind()

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 3440
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.DataSource = oDS
myAlias.Databind()

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******************@TK2MSFTNGP09.phx.gbl...
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.DataSource = oDS
myAlias.Databind()

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****************@TK2MSFTNGP11.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.DataSource = oDS
myAlias.Databind()

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******************@TK2MSFTNGP09.phx.gbl...
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.DataSource = oDS
myAlias.Databind()

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
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...
8
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...
2
by: Guru | last post by:
Hi All Can someone explain what is the difference between Alias and Nickname? Warm Regards Guru
22
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;...
5
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
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):...
3
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...
1
by: Gerhard | last post by:
How can I create a new contact in exchange server from a vb.net web application?
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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,...

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.