473,473 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

dynamic obect access

i have for exmaple few DDL
and i want each time to send to the function use the DDL name
and all the code in the function will be dnamic for example
ddlCountry.DataSource =...
will be
obj.DataSource =....
how can i do it?
and how can i do this by passing the function the object name
and doing the same as above?
thnaks in advance
peleg
Jul 14 '07 #1
1 1154
On Jul 15, 5:44 am, pelegk1 <pele...@discussions.microsoft.comwrote:
i have for exmaple few DDL
and i want each time to send to the function use the DDL name
and all the code in the function will be dnamic for example
ddlCountry.DataSource =...
will be
obj.DataSource =....
how can i do it?
and how can i do this by passing the function the object name
and doing the same as above?
thnaks in advance
peleg
Hi...

check out the following code... try in your own context...

public void DoSomeJob()
{
PopulateDropdownList(ddlcountry, ObjectDataSourceCountry);
PopulateDropdownList(ddlstate, ObjectDataSourceState);
PopulateDropdownList(ddlcity, ObjectDataSourceCity);
}

public void PopulateDropdownList(DropDownList
ddl,ObjectDataSource objectdatasource)
{
ddl.DataSource = objectdatasource;
ddl.DataTextField = "Name";
ddl.DataValueField = "ID";
ddl.DataBind();
}

Thanks
Md. Masudur Rahman (Munna)
kaz Software Ltd.
www.kaz.com.bd
http://munnacs.110mb.com

Jul 15 '07 #2

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

Similar topics

5
by: traceable1 | last post by:
I am trying to create a stored procedure with dynamic sql referencing the V$SESSION table (view). I need to use this dynamically, because the procedure will not compile if the user does not have...
7
by: Jack | last post by:
Hi, I am trying to test a sql statement in Access which gives me the error as stated in the heading. The sql statement is built as a part of asp login verification, where the userid and password...
11
by: fivelitermustang | last post by:
Actually, how would I go about allocating a four-dimensional dynamic array? I only know how to make two dimensional dynamic arrays: double **v; v = new double*; for (int i=0; i<C; i++) { v =...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
1
by: jmrieman | last post by:
I am trying to push a array or struct onto a queue then dequeue... when dequeue'ing, it is returned at type"object"... i can see the "value" is acutally the struct/array type however, once i get...
8
by: George Meng | last post by:
I got a tough question: The backgroud for this question is: I want to design an application works like a engine. After release, we can still customize a form by adding a button, and source code...
4
by: vivekian | last post by:
Hi, There is an ArrayList AppList which contains objects of the type Appliance. The type Appliance consists of a string description and a double price. In what way can an object which has been...
13
by: salad | last post by:
Operating in A97. I didn't receive much of a response conserning Pivot tables in Access. Pivot tables are nice, but a CrossTab will work for me too. Using a Pivot table, one is actually...
1
by: kvcraju123 | last post by:
what is your toughest obect in oracle d2k
4
by: Bongard | last post by:
I have a dynamic range that I would like to use as a linked table into Access. The problem is that Access doesn't seem to want to to recognize the dynamic range when you click on "show named...
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,...
1
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...
0
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...
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,...
1
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.