Re: Is there a better way to do this
- From: "Cor Ligthert[MVP]" <notmyfirstname@xxxxxxxxx>
- Date: Fri, 28 Sep 2007 05:34:31 +0200
Kah,
What is a name in this case more than a mnemonic, it should not have any connection with the outside world, you can for the same use an index, or as Kerry wrote the column itself.
There is only a very limited speed change (much less than milliseconds absolute to ignore on internet). The slowest the index, the quickest the column.
Cor
"kah" <kahsiang.wong@xxxxxxxxx> schreef in bericht news:1190939342.158701.70370@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Guys,
In my ASP.net application, i am display information using a dataset.
e.g
for each datarow in dataset.table(0).rows
label.text=datarow.item("ColumnName").tostring
next
This works perfectly fine until i have to rename a column in my table.
Obviously the easiest way to make the change is search for all
instance of the Old Column Name and replace it with the New column
Name. However this set me thinking? Is there a better way to do this?
I am thinking of creating a base class with has all the column as the
properties of the table. An another class with is a collection of this
base class. So each time i retrieve a dataset from the db. For each
row of the dataset, i will create a new instance of the base class.
Populate it with the data of that row and add it to the collection.
collection class to get all the values.From there onwards, instead of using the dataset, i can use the
Am i doing it the right way or is there a better way to go about doing
it?
.
- References:
- Is there a better way to do this
- From: kah
- Is there a better way to do this
- Prev by Date: Re: .net framework version, visual studio '03
- Next by Date: Re: Access Table and ColumnNames
- Previous by thread: Re: Is there a better way to do this
- Next by thread: Re: Is there a better way to do this
- Index(es):
Relevant Pages
|