GetYourFix()

A C# blog for the Junkies by the Junkie. .NET, C#, MS SQL, W2X and more.

About the Junkie

I am a Software and Network Engineer in Los Angeles working for a non-profit organization. I have been working on the .NET platform for the last couple of years.

I am a Mechanical Engineering graduate who defected due to a lack of interesting jobs in the field and my fascination for computers and programming. It has been a fun transition and satisfying I might add.It can be very frustrating when you hit a roadblock while programming, the blogs and other resources can be life savers during this time and have helped me immensely on many occasions. I have always wanted to have a blog to share the problems and their fixes. And I have finally taken the plunge.

I hope this blog helps.

.NET Junkie

Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Inserting and Updating Enum values in Detailsview with Objectdatasource

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]


Categories: Programming