I have a seating chart web form that has over 50 entry field controls
(tables/booths) where I use a DropDownList box to select a single company
name from a single large list of organizations (200 plus conference
attendees). All web form datavalues will be one of the same 200
organizations in this list. I would like to avoid creating 50 separate exact
copies of the same DataSet object. Can you help?
Q. Exactly how do I use the same DataSet object in all 50 DropDownList boxes
on my web form with out creating it 49 more times? Isn't there a simple
way of "referring to" or "cloning" or binding each of the 50 web controls to
the same (single dataset created by a single db query). 3 1726
If all of the controls are on the same form, and assuming they have a
similar name that's different from other drop down lists on the form
(assuming their are others), you can iterate through all the controls on the
form, and for all combo boxes that match your name criteria, you could bind
the dataset to them. Something like:
DataSet ds = GetMyDataSet();
foreach(Control ctrl in this.Controls)
{
if (ctrl.GetType() == typeof(DropDown List) && ctrl.Name.Subst ring(1, 4) ==
"seat")
{
((DropDownList) ctrl).DataSourc e = ds;
((DropDownList) ctrl).DataBind( );
}
}
-- http://www.petedavis.net
"Bill" <bc****@mcleodu sa.net> wrote in message
news:eC******** ******@TK2MSFTN GP12.phx.gbl... I have a seating chart web form that has over 50 entry field controls (tables/booths) where I use a DropDownList box to select a single company name from a single large list of organizations (200 plus conference attendees). All web form datavalues will be one of the same 200 organizations in this list. I would like to avoid creating 50 separate
exact copies of the same DataSet object. Can you help?
Q. Exactly how do I use the same DataSet object in all 50 DropDownList
boxes on my web form with out creating it 49 more times? Isn't there a simple way of "referring to" or "cloning" or binding each of the 50 web controls
to the same (single dataset created by a single db query).
Thanks a bunch..this looks like it will handle my needs.
"Pete Davis" <pd******@hotma il.com> wrote in message
news:d0******** *************** *******@news.me ganetnews.com.. . If all of the controls are on the same form, and assuming they have a similar name that's different from other drop down lists on the form (assuming their are others), you can iterate through all the controls on
the form, and for all combo boxes that match your name criteria, you could
bind the dataset to them. Something like:
DataSet ds = GetMyDataSet();
foreach(Control ctrl in this.Controls) { if (ctrl.GetType() == typeof(DropDown List) && ctrl.Name.Subst ring(1, 4)
== "seat") { ((DropDownList) ctrl).DataSourc e = ds; ((DropDownList) ctrl).DataBind( ); } }
-- http://www.petedavis.net "Bill" <bc****@mcleodu sa.net> wrote in message news:eC******** ******@TK2MSFTN GP12.phx.gbl... I have a seating chart web form that has over 50 entry field controls (tables/booths) where I use a DropDownList box to select a single
company name from a single large list of organizations (200 plus conference attendees). All web form datavalues will be one of the same 200 organizations in this list. I would like to avoid creating 50 separate exact copies of the same DataSet object. Can you help?
Q. Exactly how do I use the same DataSet object in all 50 DropDownList boxes on my web form with out creating it 49 more times? Isn't there a
simple way of "referring to" or "cloning" or binding each of the 50 web
controls to the same (single dataset created by a single db query).
Thanks to all. Your advise has helped allot. But now, you've got me
thinking....
Essentially, what I have here is 50 row entrees (w/ boot ID,
location, assigned company).
What I really would like here is the underlying function of an "editable"
datagrid
control (with dropdown list boxes of course) AND a "none grid" like display
(freely displayed/placed over a floor & booth diagram).
I need to retrieve, display and edit all 50 rows of data but I need to
spread them randomly over a floor/booth configuration diagram.
Is there anyway I can easily enjoy the best of both worlds? The efficiency
of handling datasets using a datagrid kind of control and the flexibility of
data display unrestricted to a column and row format. "Pete Davis" <pd******@hotma il.com> wrote in message news:d0******** *************** *******@news.me ganetnews.com.. . If all of the controls are on the same form, and assuming they have a similar name that's different from other drop down lists on the form (assuming their are others), you can iterate through all the controls on the form, and for all combo boxes that match your name criteria, you could bind the dataset to them. Something like:
DataSet ds = GetMyDataSet();
foreach(Control ctrl in this.Controls) { if (ctrl.GetType() == typeof(DropDown List) && ctrl.Name.Subst ring(1,
4) == "seat") { ((DropDownList) ctrl).DataSourc e = ds; ((DropDownList) ctrl).DataBind( ); } }
-- http://www.petedavis.net "Bill" <bc****@mcleodu sa.net> wrote in message news:eC******** ******@TK2MSFTN GP12.phx.gbl... I have a seating chart web form that has over 50 entry field controls (tables/booths) where I use a DropDownList box to select a single company name from a single large list of organizations (200 plus conference attendees). All web form datavalues will be one of the same 200 organizations in this list. I would like to avoid creating 50 separate exact copies of the same DataSet object. Can you help?
Q. Exactly how do I use the same DataSet object in all 50 DropDownList boxes on my web form with out creating it 49 more times? Isn't there a simple way of "referring to" or "cloning" or binding each of the 50 web controls to the same (single dataset created by a single db query).
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Patrick |
last post by:
I'm working on a contact management application, and need a hand with one
aspect...
Here's what I want to create:
------------------------------------
A form split into two parts. There is a datagrid on the left side that lists
names and perhaps a couple of other key fields. The user can click on a
record in the datagrid, which should automatically pull up details on that
record in the various text boxes and other controls on the right...
|
by: Iain Kirk |
last post by:
Being a bit of a novice any help or pointers would be appreciated.
I am building a web page that populates a DropDowList from a table in SQL,
for testing purposes i have a simple page that displays a datagrid with the
same data, now this does work so i know the data is there but the
dropdownlist is empty. If anyone could show me where i'm going wrong i would
be very thankful.
Here is the code i am using:
|
by: Bill |
last post by:
I have a seating chart web form that has over 50 entry field controls
(tables/booths) where I use a DropDownList box to select a single company
name from a single large list of organizations (200 plus conference
attendees). All web form datavalues will be one of the same 200
organizations in this list. I would like to avoid creating 50 separate exact
copies of the same DataSet object. Can you help?
Q. Exactly how do I use the same...
|
by: ASP Yaboh |
last post by:
I have an ArrayList of data gathered from a database. I want to create a web
page from this data by creating a <table>, each cell in each row displays the
appropriate data. One of those cells in each row needs a <textarea> control.
The background supporting classes are completed, the only task left now is
to create the web page. I am at a loss on how to create the table in the page
populated by the data. Previously, I would have just...
|
by: Bishoy George |
last post by:
I have a dataset called ds1 filled with 2 tables Employees and Customers
from Northwind database.
I have dropdownList called ddLastName with the following properties:
ddLastName.DataSource = ds1;
ddLastName.DataMember = "Employees";
ddLastName.DataTextField = "LastName";
ddLastName.DataBind();
ddLastName.Items.Insert(0,"Select:");
| |
by: Gary Shell |
last post by:
Sorry for the crosspost, I initially posted this to the
microsoft.public.dotnet.languages.vb.data
group, but it never showed up there. (Is that newsgroup still active???)
I have two datasets declared on a single form. The form is instantiated by
another form which passes two parameters to the form. These parameters are
used to select the data for each of the two datasets.
The first dataset loads fine as does the second one. If...
|
by: ^MisterJingo^ |
last post by:
Hi all,
I have a form with 4 dropdownlist controls which I populate with data
from DB tables. I have a class with a method which constructs a
dataset, putting each DB table into a dataset table. I then return the
DS and bind the tables to the relevant controls.
I've been reading that DataReaders are much more efficient than
DS's for getting data from the database.
So would it better to have 4 methods, each returning a dataReader, or...
|
by: MaryamSh |
last post by:
Hi,
I am creating a Dynamic Search in my application.
I create a user control and in Page_load event I create a dynamic dropdownlist and 2 dynamic button (Add,Remove)
By pressing Add button ,another row will be created with the same control (I mean another dropdown and 2 button) and so on.
and by pressing Remove button the selecetd row will be removed.
I used viewstate to keep my value for postback,
I want by changing selectedvalue of...
|
by: MaryamSh |
last post by:
Create Dynamic Dropdownlist Controls and related event
--------------------------------------------------------------------------------
Hi,
I am creating a Dynamic Search in my application.
I create a user control and in Page_load event I create a dynamic dropdownlist and 2 dynamic button (Add,Remove)
By pressing Add button ,another row will be created with the same control (I mean another dropdown and 2 button) and so on.
and by...
|
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...
|
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...
| |
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...
|
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,...
|
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...
|
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...
|
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();...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |