Collections

I

Islamegy®

In my C# web Application... I mapped each Datatable table to Strongly typed
CustomCollection inherited from CollectionBase to follow N-Tier model
instead of Datatables and Dataset..

So i Use DataReader & ExcuteNonQuery on Transaction with Database for best
preformance but I'm unable to save my collection state.. so after anybost
back my collection cleared!! (
I tried cach it in page init then retrieve it back before each operation
then cache it again, but it don't make sense to me..
How could i make my collection manage it's own state like Dataset Do??

Any Help plzzzz
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

Is this a web app?

What about if you store your collection in the session?

Does the type you implemented keeps its status? maybe with a flag to signal
if it change something and later call a Save() to persist the data to the
db?


cheers,
 
I

Islamegy®

I don't have problem in the database, the record inserted successfully in
the database then in the collection too. but the collection get cleared
after next postback..
Save into session is like save into cache.. what is the diffrent??

when i use Dataset i never worry about it's state coz i will always find all
rows there even few copies of them (RowState) without explicitly add it to
session or cache??

2- my collection implement ISerializable, how could i deserialize my
strongly type collection while List , InnerList is readonly??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top