Last post Jul 06, 2016 02:38 PM by PatriceSc
Jan 13, 2016 10:04 AM|Yeoman|LINK
I am always having serious problems with the "business logic layer" of my application. It's so frustrating that I am thinking about moving away from ObjectDataSource/DataSets (xsd) back to simple SqlDataSources, where the configuration is always visible
to me and not hidden in tons of generated code...
Here is what I experienced:
A few days ago, I added a new column to a database table. To make it visible to my app, I opened the DataSet (xsd) and the TableAdapter, selected "Configure" and "Finish". The new attribute was appended at the end of the list. (I would prefer to do some
kind of "reload" so that the attributes appear in the same order as in the table, but this does not seem to be possible.)
So far so good. Today, I found that an aspx page doesn't work anymore:
SELECT idx, num, name, type, dbo.get_match(idx, CONVERT (datetime, @t0, 104), CONVERT (datetime, @t1, 104), @num, @bst) AS match FROM rmv_room_conference WHERE (dbo.get_match(idx, CONVERT (datetime, @t0, 104), CONVERT (datetime, @t1, 104), @num, @bst)<>'0') ORDER BY num,name;
Well, in the meantime, touching the DataSets and TableAdapters seems to be like an adventure to me.
Whatever I do, I always have to expect that something gets broken because of some internal, nontransparent regeneration procedures.
This is not like working with a robust tool and a robust code base. It's more like playing cat and mouse with the IDE!
Can I change something about this?
How do you deal with these problems?
Jul 06, 2016 01:55 PM|bth_vijay|LINK
When we use ready-made items then we have to use with precautions so this is also apply with ADO.Net. I can suggest either you switch to some data access library like Microsoft Enterprise Library etc or whenever you do anything handle with care.
Jul 06, 2016 02:38 PM|PatriceSc|LINK
It seems rather a problem with the typed dataset side rather than really with ObjectDataSource etc... This is a custom SQL statement and maybe it has been reset when refreshing your typed datasets from the base table. I never really used and never liked
typed datasets. I prefer either to use ADO.NET or Entity Framework. I always find typed dataset as an in between mixed approach that doesn't bring enough difference and benefit between both.
For new application I would suggest to have a look at model binding which is available as well in Web Forms now :
http://www.asp.net/web-forms/overview/presenting-and-managing-data/model-binding/retrieving-data (and so I would use "raw" ADO.NET or Entity Framework and would avoid typed dataset).
Then I don't believe there is a "best" solution and at some point it is also my personal preference and views on the subject.
Edit: for a low change solution another option might be to use a view or a computed column so that the tooling thinks it is just a simple table.