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

Array as a datasource

I have a FormView that has several columns from a database that need to pick
(using DropDownList) from a static set of values and text as shown below:

value="" text = ""
value="n/a" text="n/a"
value="0" text="No"
value="-1" text="Yes"

Should I use an ObjectDataSource for these or something else? I have not
used an ObjectDataSource yet, so it is new for me. Thanks.

David
Oct 11 '07 #1
8 1788
If these are all the possible values and will never change then add
manually.

I am interested to know the overhead using ObjectDataSource

Hope some more opinionated person ( right or wrong) moves you in some
direction because it might not matter.
caching is good also


"David C" <dl*****@lifetimeinc.comwrote in message
news:Op****************@TK2MSFTNGP03.phx.gbl...
>I have a FormView that has several columns from a database that need to
pick (using DropDownList) from a static set of values and text as shown
below:

value="" text = ""
value="n/a" text="n/a"
value="0" text="No"
value="-1" text="Yes"

Should I use an ObjectDataSource for these or something else? I have not
used an ObjectDataSource yet, so it is new for me. Thanks.

David

Oct 11 '07 #2
I have about six columns that will use this so I am looking for a different
alternative that manually entered itemlist. I could put it a static SQL
table but it seems silly.

David
"IfThenElse" <sq**********@hotmail.comwrote in message
news:O1**************@TK2MSFTNGP02.phx.gbl...
If these are all the possible values and will never change then add
manually.

I am interested to know the overhead using ObjectDataSource

Hope some more opinionated person ( right or wrong) moves you in some
direction because it might not matter.
caching is good also


"David C" <dl*****@lifetimeinc.comwrote in message
news:Op****************@TK2MSFTNGP03.phx.gbl...
>>I have a FormView that has several columns from a database that need to
pick (using DropDownList) from a static set of values and text as shown
below:

value="" text = ""
value="n/a" text="n/a"
value="0" text="No"
value="-1" text="Yes"

Should I use an ObjectDataSource for these or something else? I have not
used an ObjectDataSource yet, so it is new for me. Thanks.

David


Oct 11 '07 #3
Assign them to the ItemList, and reuse it over and over again,
I am not asking your user to manually enter anything.
"David C" <dl*****@lifetimeinc.comwrote in message
news:uz*************@TK2MSFTNGP02.phx.gbl...
>I have about six columns that will use this so I am looking for a different
alternative that manually entered itemlist. I could put it a static SQL
table but it seems silly.

David
"IfThenElse" <sq**********@hotmail.comwrote in message
news:O1**************@TK2MSFTNGP02.phx.gbl...
>If these are all the possible values and will never change then add
manually.

I am interested to know the overhead using ObjectDataSource

Hope some more opinionated person ( right or wrong) moves you in some
direction because it might not matter.
caching is good also


"David C" <dl*****@lifetimeinc.comwrote in message
news:Op****************@TK2MSFTNGP03.phx.gbl...
>>>I have a FormView that has several columns from a database that need to
pick (using DropDownList) from a static set of values and text as shown
below:

value="" text = ""
value="n/a" text="n/a"
value="0" text="No"
value="-1" text="Yes"

Should I use an ObjectDataSource for these or something else? I have
not used an ObjectDataSource yet, so it is new for me. Thanks.

David



Oct 11 '07 #4
I meant me entering them in manually in my 12 DropDownList controls (6 in
read, 6 in edit).

"IfThenElse" <sq**********@hotmail.comwrote in message
news:OB**************@TK2MSFTNGP02.phx.gbl...
Assign them to the ItemList, and reuse it over and over again,
I am not asking your user to manually enter anything.
"David C" <dl*****@lifetimeinc.comwrote in message
news:uz*************@TK2MSFTNGP02.phx.gbl...
>>I have about six columns that will use this so I am looking for a
different alternative that manually entered itemlist. I could put it a
static SQL table but it seems silly.

David
"IfThenElse" <sq**********@hotmail.comwrote in message
news:O1**************@TK2MSFTNGP02.phx.gbl...
>>If these are all the possible values and will never change then add
manually.

I am interested to know the overhead using ObjectDataSource

Hope some more opinionated person ( right or wrong) moves you in some
direction because it might not matter.
caching is good also


"David C" <dl*****@lifetimeinc.comwrote in message
news:Op****************@TK2MSFTNGP03.phx.gbl.. .
I have a FormView that has several columns from a database that need to
pick (using DropDownList) from a static set of values and text as shown
below:

value="" text = ""
value="n/a" text="n/a"
value="0" text="No"
value="-1" text="Yes"

Should I use an ObjectDataSource for these or something else? I have
not used an ObjectDataSource yet, so it is new for me. Thanks.

David



Oct 11 '07 #5
all you need is to clone and use the ItemsList.
Or I just don't understand what you want?

I had a dropdown list in every row, possibly 25 ( using paging and depending
on page size )
I just clone and reuse my collectionList that holds my items to the dropdown
list

"David C" <dl*****@lifetimeinc.comwrote in message
news:Ob**************@TK2MSFTNGP02.phx.gbl...
>I meant me entering them in manually in my 12 DropDownList controls (6 in
read, 6 in edit).

"IfThenElse" <sq**********@hotmail.comwrote in message
news:OB**************@TK2MSFTNGP02.phx.gbl...
>Assign them to the ItemList, and reuse it over and over again,
I am not asking your user to manually enter anything.
"David C" <dl*****@lifetimeinc.comwrote in message
news:uz*************@TK2MSFTNGP02.phx.gbl...
>>>I have about six columns that will use this so I am looking for a
different alternative that manually entered itemlist. I could put it a
static SQL table but it seems silly.

David
"IfThenElse" <sq**********@hotmail.comwrote in message
news:O1**************@TK2MSFTNGP02.phx.gbl...
If these are all the possible values and will never change then add
manually.

I am interested to know the overhead using ObjectDataSource

Hope some more opinionated person ( right or wrong) moves you in some
direction because it might not matter.
caching is good also


"David C" <dl*****@lifetimeinc.comwrote in message
news:Op****************@TK2MSFTNGP03.phx.gbl. ..
>I have a FormView that has several columns from a database that need to
>pick (using DropDownList) from a static set of values and text as shown
>below:
>
value="" text = ""
value="n/a" text="n/a"
value="0" text="No"
value="-1" text="Yes"
>
Should I use an ObjectDataSource for these or something else? I have
not used an ObjectDataSource yet, so it is new for me. Thanks.
>
David
>




Oct 11 '07 #6
I haven't cloned an ItemList before. How is that done?

"IfThenElse" <sq**********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
all you need is to clone and use the ItemsList.
Or I just don't understand what you want?

I had a dropdown list in every row, possibly 25 ( using paging and
depending on page size )
I just clone and reuse my collectionList that holds my items to the
dropdown list

"David C" <dl*****@lifetimeinc.comwrote in message
news:Ob**************@TK2MSFTNGP02.phx.gbl...
>>I meant me entering them in manually in my 12 DropDownList controls (6 in
read, 6 in edit).

"IfThenElse" <sq**********@hotmail.comwrote in message
news:OB**************@TK2MSFTNGP02.phx.gbl...
>>Assign them to the ItemList, and reuse it over and over again,
I am not asking your user to manually enter anything.
"David C" <dl*****@lifetimeinc.comwrote in message
news:uz*************@TK2MSFTNGP02.phx.gbl...
I have about six columns that will use this so I am looking for a
different alternative that manually entered itemlist. I could put it a
static SQL table but it seems silly.

David
"IfThenElse" <sq**********@hotmail.comwrote in message
news:O1**************@TK2MSFTNGP02.phx.gbl...
If these are all the possible values and will never change then add
manually.
>
I am interested to know the overhead using ObjectDataSource
>
Hope some more opinionated person ( right or wrong) moves you in some
direction because it might not matter.
caching is good also
>
>
>
>
"David C" <dl*****@lifetimeinc.comwrote in message
news:Op****************@TK2MSFTNGP03.phx.gbl.. .
>>I have a FormView that has several columns from a database that need
>>to pick (using DropDownList) from a static set of values and text as
>>shown below:
>>
>value="" text = ""
>value="n/a" text="n/a"
>value="0" text="No"
>value="-1" text="Yes"
>>
>Should I use an ObjectDataSource for these or something else? I have
>not used an ObjectDataSource yet, so it is new for me. Thanks.
>>
>David
>>
>
>




Oct 11 '07 #7
You can bind to the same collection and might not need Cloning.

or

Some classes provide the Clone Method for you. Like

ArrayList al = new ArrayList();

ArrayList al2 = null;

al2 = al.Clone();

When the Clone Method does not exist then create one yourself.

create an ItemsListCollection object, or what ever collection you want,
then call a Private method you created to populate it from another like
object. That is cloning.

You can use an ArrayList may be to bind to as above.



"David C" <dl*****@lifetimeinc.comwrote in message
news:eU**************@TK2MSFTNGP04.phx.gbl...
>I haven't cloned an ItemList before. How is that done?

"IfThenElse" <sq**********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>all you need is to clone and use the ItemsList.
Or I just don't understand what you want?

I had a dropdown list in every row, possibly 25 ( using paging and
depending on page size )
I just clone and reuse my collectionList that holds my items to the
dropdown list

"David C" <dl*****@lifetimeinc.comwrote in message
news:Ob**************@TK2MSFTNGP02.phx.gbl...
>>>I meant me entering them in manually in my 12 DropDownList controls (6 in
read, 6 in edit).

"IfThenElse" <sq**********@hotmail.comwrote in message
news:OB**************@TK2MSFTNGP02.phx.gbl...
Assign them to the ItemList, and reuse it over and over again,
I am not asking your user to manually enter anything.
"David C" <dl*****@lifetimeinc.comwrote in message
news:uz*************@TK2MSFTNGP02.phx.gbl...
>I have about six columns that will use this so I am looking for a
>different alternative that manually entered itemlist. I could put it a
>static SQL table but it seems silly.
>
David
"IfThenElse" <sq**********@hotmail.comwrote in message
news:O1**************@TK2MSFTNGP02.phx.gbl.. .
>If these are all the possible values and will never change then add
>manually.
>>
>I am interested to know the overhead using ObjectDataSource
>>
>Hope some more opinionated person ( right or wrong) moves you in some
>direction because it might not matter.
>caching is good also
>>
>>
>>
>>
>"David C" <dl*****@lifetimeinc.comwrote in message
>news:Op****************@TK2MSFTNGP03.phx.gbl. ..
>>>I have a FormView that has several columns from a database that need
>>>to pick (using DropDownList) from a static set of values and text as
>>>shown below:
>>>
>>value="" text = ""
>>value="n/a" text="n/a"
>>value="0" text="No"
>>value="-1" text="Yes"
>>>
>>Should I use an ObjectDataSource for these or something else? I
>>have not used an ObjectDataSource yet, so it is new for me. Thanks.
>>>
>>David
>>>
>>
>>
>
>




Oct 11 '07 #8
Thank you.
"IfThenElse" <sq**********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
You can bind to the same collection and might not need Cloning.

or

Some classes provide the Clone Method for you. Like

ArrayList al = new ArrayList();

ArrayList al2 = null;

al2 = al.Clone();

When the Clone Method does not exist then create one yourself.

create an ItemsListCollection object, or what ever collection you want,
then call a Private method you created to populate it from another like
object. That is cloning.

You can use an ArrayList may be to bind to as above.



"David C" <dl*****@lifetimeinc.comwrote in message
news:eU**************@TK2MSFTNGP04.phx.gbl...
>>I haven't cloned an ItemList before. How is that done?

"IfThenElse" <sq**********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>>all you need is to clone and use the ItemsList.
Or I just don't understand what you want?

I had a dropdown list in every row, possibly 25 ( using paging and
depending on page size )
I just clone and reuse my collectionList that holds my items to the
dropdown list

"David C" <dl*****@lifetimeinc.comwrote in message
news:Ob**************@TK2MSFTNGP02.phx.gbl...
I meant me entering them in manually in my 12 DropDownList controls (6
in read, 6 in edit).

"IfThenElse" <sq**********@hotmail.comwrote in message
news:OB**************@TK2MSFTNGP02.phx.gbl...
Assign them to the ItemList, and reuse it over and over again,
I am not asking your user to manually enter anything.
>
>
"David C" <dl*****@lifetimeinc.comwrote in message
news:uz*************@TK2MSFTNGP02.phx.gbl...
>>I have about six columns that will use this so I am looking for a
>>different alternative that manually entered itemlist. I could put it
>>a static SQL table but it seems silly.
>>
>David
>"IfThenElse" <sq**********@hotmail.comwrote in message
>news:O1**************@TK2MSFTNGP02.phx.gbl. ..
>>If these are all the possible values and will never change then add
>>manually.
>>>
>>I am interested to know the overhead using ObjectDataSource
>>>
>>Hope some more opinionated person ( right or wrong) moves you in
>>some direction because it might not matter.
>>caching is good also
>>>
>>>
>>>
>>>
>>"David C" <dl*****@lifetimeinc.comwrote in message
>>news:Op****************@TK2MSFTNGP03.phx.gbl ...
>>>>I have a FormView that has several columns from a database that need
>>>>to pick (using DropDownList) from a static set of values and text as
>>>>shown below:
>>>>
>>>value="" text = ""
>>>value="n/a" text="n/a"
>>>value="0" text="No"
>>>value="-1" text="Yes"
>>>>
>>>Should I use an ObjectDataSource for these or something else? I
>>>have not used an ObjectDataSource yet, so it is new for me.
>>>Thanks.
>>>>
>>>David
>>>>
>>>
>>>
>>
>>
>
>




Oct 12 '07 #9

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

Similar topics

3
by: AFN | last post by:
I need to manually create the data to be shown in a datagrid (or some data table object). Should I create an array and bind the array to the datagrid OR should I create a temporary dataset and...
1
by: ad | last post by:
Is it necessary to use dataset as the datasource of a listbox? can I use an array as the datasource of a ListBox?
3
by: Microsoft | last post by:
I am able to set the datasource of a datagrid as a simple array, but on the form it only displays the length of the strings in the array. Not the actual items in the string. Dim lastpatch As...
11
by: Zorpiedoman | last post by:
The problem is this: I have a list box. I set an array list as the datasource. I remove an item from the array list. I set the listbox datasource to nothing. I set the listbox datasource to...
4
by: Jim Shaffer | last post by:
Perhaps I have the wrong construct, or misunderstand arrays in vb (2003).... I've loaded a two-dimensional array (168 by 28) into memory as AcctArray. {Dim AcctArray (500,28) as string...} The...
10
by: mark | last post by:
I have a simple windows application that has a function to read a csv file and enter the values into an array A as double(,). Also, an instance of form 2 (which has a DataGrid) is created and the...
6
by: Paul | last post by:
Hi All, Framework 1.1 listbox control unable to DataBind I've been googling for an answer to this query that appears quite a lot, but none, it seem, answers my problem directly. I am...
1
by: pauled | last post by:
Hello all, Framework 1.1 VS 2003 Binding listbox. I have an array of objects that I am trying to use as the datasource for a listbox. The array is returned from a webservice and seems to be...
6
by: Paulers | last post by:
Hello, I have a string that I am trying to add each char to a datatable row. for example if I have a string that looks like "abcdefg", I would like to break it up into an array of characters...
2
by: shahiz | last post by:
basically im having null pointer exception //read an inputstream is = new DataInputStream(new FileInputStream("test.mpg")); loadBytes(is); //pass it as a datasource for the player public...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...

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.