Actually , I often get a row of information from a database that may be
user-specific, and I take the one DataRow from the resulting DataTable and
stick it in Session. Working with a DataRow is quite intuitive and it's a
pretty lightweight object IMHO. So you could do
string firstName=(string)((DataRow)Session["myRow"])["FirstName"];
-- for example.
I don't particularly feel compelled to create a special object for this
stuff when I can get at it easily as above, especially if i don't need to
access it often.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,
"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.comwrote in message
news:83**********************************@microsof t.com...
"Of course, a table that you know for sure will always have only one
record
is not a table but a record, you better use another structure to hold this
info. "
?-- What' wrong with using a DataTable that you know only has one DataRow?
I do this all the time.
Peter
IMO this is usually used when you are keeping config info or when you have
an unique instance of some piece of data.
In both cases is more clear to define a class with properties to access the
info instead of using a DataTable.
Now the OP did not state that this is the case so my suggestion may not
apply in this particular case.
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation