Hi!
Quote:
I have a screen that contains a grid of a number of objects, say Customers. The user can click on a customer and edit the details and so on. I handle the grid events by storing the id of a customer in a hidden column so I know which one the user has clicked on.
You do not need the id of a customer in
WindowForms.NET (you can get a direct reference to you object using "
bindingSource.Current" in
.NET 2.0
(
http://www.windowsforms.net/Samples/Go% ... %20FAQ.doc ) or
BindingContext[objectView].Current in
.NET 1.x (
http://msdn.microsoft.com/library/defau ... 122002.asp )
Now... in
ASP.NET you do not have "
direct databinding to in memory objects" so your idea of using negative ids could be useful... (
I have seen it implemented in the DataSet... and in other ORMs for example Apple's EOF or EntityBroker) in my experience most
Java Hibernate users commit things to the database on every request... seems to be the recommended way of doing things... or at least Hibernate does not seem to provide help to do something else... and
I guess that is what most ASP.NET NHibernate users do (I have done it that way)... I would be nice to know what is the recommended practice to avoid commiting to the database on every request....