Posted by Junkie
on Wednesday, November 04, 2009 3:31 PM
If you use nchar(n) for a column, say n=5 and the length of the string you enter for this column is 3. MS SQL adds whitespace to this string to make it 5 characters long. Be mindful of that, this can break a DropDownList when you try to assign this string as the SelectedValue and the dropdownlist is pre-populated manually or from a different source. I of course learnt this the hard way after spending considerable time.
8b60d88b-92b6-4445-8414-efc2b912019a|0|.0
Posted by Junkie
on Wednesday, November 04, 2009 3:16 PM
I recently had to use the detailsview with my custom object ‘Subscriber’ which had a property ‘Subscription’ of type enum. I ran into a problem when inserting / updating this object. During this operation I received the error ‘Objectdatasource couldnt find a non-generic method….’ .I used the Objectdatasource to bind the ‘Subscriber’ object to the Detailsview. When I did this, the Detailsview didn't not automatically generate the column for the enum property ‘Subcription’, but the ObjectDataSource’s parameters list had this enum listed, I had to manually add this property as a column. After spending sometime I found the solution, which I have presented below.
Enum:
public enum Subscription
{
Unsubscribed,
New,
Subscribed
}
Custom Object:
[DataObject]
public class Subscriber : BusinessObject
{
private int _subscriberID = 0;
publ...
[More]
2be02534-3cb2-45ff-911e-ecd34d3eafb4|0|.0