1. If I use an ArrayList as my data source, how do I construct the accessor
methods? That is, forget about properties for a moment, if I wanted the 5th
item in the ArrayList, I would write the method:
public string getTheField(int index) { ... } - where index would equal 4.
How is this written into the property? Does reflection take care of getting
the appropriate value?
2. Expanding on that, say I have an ArrayList of ArrayLists where the inner
ArrayLists correspond to rows in a database resultset. So, here the 5th field
in the outer ArrayList gets the 5th deeper ArrayList which is the 5th row of
data. Can the methods/properties be constructed to do this? If so, cold you
provide a brief example of the syntax. It would clear up some questions I
have. (I'm translating some old JSP code.)
Thank you for your time. 1 1437
> 1. If I use an ArrayList as my data source, how do I construct the
accessor methods? That is, forget about properties for a moment, if I wanted the
5th item in the ArrayList, I would write the method:
public string getTheField(int index) { ... } - where index would equal
4. How is this written into the property? Does reflection take care of
getting the appropriate value?
(Scratching my head for a moment...)
An ArrayList is an existing Collection, which can be used in DataBinding.
Other than that, I can't make sense of your question. An ArrayList already
has a get and set method for the Item property. Neither of them have much of
anything to do with databinding. And you certainly don't need to define
("construct") them.
2. Expanding on that, say I have an ArrayList of ArrayLists where the
inner ArrayLists correspond to rows in a database resultset. So, here the 5th
field in the outer ArrayList gets the 5th deeper ArrayList which is the 5th row
of data. Can the methods/properties be constructed to do this? If so, cold
you provide a brief example of the syntax. It would clear up some questions I have. (I'm translating some old JSP code.)
(Going to get some aspirin for my head...)
The first "road" went off track somewhere. The second "road" expands on
that, which means we're both totally lost now.
Maybe you could try again?
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
"ASP Yaboh" <AS******@discussions.microsoft.com> wrote in message
news:18**********************************@microsof t.com... 1. If I use an ArrayList as my data source, how do I construct the
accessor methods? That is, forget about properties for a moment, if I wanted the
5th item in the ArrayList, I would write the method:
public string getTheField(int index) { ... } - where index would equal
4. How is this written into the property? Does reflection take care of
getting the appropriate value?
2. Expanding on that, say I have an ArrayList of ArrayLists where the
inner ArrayLists correspond to rows in a database resultset. So, here the 5th
field in the outer ArrayList gets the 5th deeper ArrayList which is the 5th row
of data. Can the methods/properties be constructed to do this? If so, cold
you provide a brief example of the syntax. It would clear up some questions I have. (I'm translating some old JSP code.)
Thank you for your time. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: autofill |
last post by:
2 scenario inside a WebUserControl. I want to know why Microsoft and so many
book doesn't suggest us to work like that. This control going to be in my
page and I will call the DataBind of my...
|
by: Marty McDonald |
last post by:
I have <asp:Table... </asp:Table> on my webform. In codebehind, I populate
a DataTable whose data should appear in the asp:Table. I created my own
code to populate the asp:Table with the...
|
by: Thomas Jespersen |
last post by:
Hello
How do I databind a ASP.NET Texbox to a custom object.
I a WinForm I do it like this:
Dim myCustomerObject As Customer()
Private Sub CreateNewCustomer
myCustomerObject = New...
|
by: aualias |
last post by:
This seems like such a lame question, but how do you bind to a CheckBox with
ASP.NET? With Windows Forms there is a DataBindings collection. I do not
see it with the web version of the control,...
|
by: Jim Bancroft |
last post by:
Hi everyone,
I have a DropDownList I populate as outlined below. This is from my
code-behind file:
private void Page_Load(object sender, System.EventArgs e)
{
BindMyData();
DataBind();
}
| |
by: Rourke Eleven |
last post by:
I have looked and searched. What good is the databind property on
Radiobuttons? How does one go about actually using it? What is a good
resource on this? I understand that I can easily get/set...
|
by: Adam J Knight |
last post by:
Hi all,
I am trying to bind a value to a hyperlink control.
For some reason it isn't working.
What have i missed?
<asp:HyperLink ID="lnkQuestions" NavigateUrl='Questions.aspx?ID=<%#...
|
by: zhshqzyc |
last post by:
Hi,
I am going to create two aspx pages.
The first page will display the whole content of a table which is from a DataSet.
DataSet myDataSet = new DataSet();
try
{
...
|
by: Jonathan Wood |
last post by:
I have a databound dropdownlist control. Based on some other criteria, I
need to specify the selected item in my pages Load event.
The problem is that, in my load event, the control does not yet...
|
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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
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,...
|
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...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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...
| |