NetTiers EntityGridView Deepload display readonly lookup

If you need your netTiers gridview (EntityGridView) to have a column that just displays a read only value from a lookup table then the data source will need to deepload but <asp:BoundField> won’t be able to access the lookup value. NetTiers’ own controls are only dropdowns, hyperlinks and radiobuttons, so to display the lookup value (rather than the ID), you need to add a template field <asp:TemplateField> <ItemTemplate> <%# Eval("ApplicIdSource.Applic")%> </ItemTemplate> </asp:TemplateField> as described here: ...

February 8, 2011 · 1 min

ID fields

Don’t name a field ID, id or Id If you ask NetTiers to generate an admin website, then it will show warnings when compiled but these will result in errors when you try to run the site. Even if you don’t want an admin website to start with, you may want one later, so just don’t name any fields ID

November 25, 2010 · 1 min

IF statements in custom stored procedures

You may want your custom stored procedures to contain conditional statements such as IF. These can cause problems when NetTiers inspects the procedure to determine its outputs – it may normally return a table but an IF statement traps for an exception and conditionally returns before the select statement. You can force NetTiers to follow one route through the code e.g. the statement below will never return for NetTiers IF user_name() <> 'NetTiersUserAccount' AND ThingToTest = ValueThatMakesItReturn RETURN Just make sure that the user account in the connection string used by NetTiers is not used by anything other than NetTiers i.e. not in you web.config

August 25, 2010 · 1 min

System.Reflection.AmbiguousMatchException: Ambiguous match found.

If you get this error with NetTiers, it’s probably because you have a field named with a reserved word such as: Tag ID SortOrder Rename the field

October 20, 2009 · 1 min

completely close and re-open NetTiers after database changes

If you have NetTiers open and have generated code, then make changes to the database, you need to completely close and re-open CodeSmith / NetTiers for it to fully recognise the changes. Something or other gets cached and NetTiers doesn’t spot the database changes – this was a pain to track down.

September 24, 2009 · 1 min

SortOrder

Don’t call a field in the database “SortOrder” It breaks nettiers in subtle ways that are hard to spot

September 23, 2009 · 1 min

empty fields

I’d set up the MedicineExaminers system to not allow nulls on any fields – they were supposed to contain empty strings if there was no data e.g. no email address. The NetTiers generated site didn’t like this as it made the fields required. I’ve changed the fields to allow nulls and so now, if I have an empty text box, NetTiers sets the value to null in the database. Lookup lists (e.g. speciality) will have values such as “not known”, so foreign keys will never need to be null.

April 3, 2008 · 1 min