January 2008 - Posts
Yesterday in the "Coolness of SubSonic" post I had a bit of asp.net markup (as I call it) that would display data in a data list from the data source. It specifically used.
<%# Eval("Name") %>
For a long time I have wondered how that worked I could never seem to figure it out until yesterday. Basically, you have an object that you bind to the data control like a datalist. In the case yesterday it was a Product class Object:

Well in the asp.net markup that we have below:
Notice in the Eval part it uses Name also notice from the product class above there is a name property. What ever property the object has you can use that in the Eval and it will display the data in there that comes from our collection of objects. In this case the Name property of our collection of Product Objects.
I know this wasn't a "cool" post, but it is something I was excited to finally understand so I thought I would post on it to help others understand hopefully.
From my last post
SQL Parameters in C# I mentioned that I wanted to learn an ORM package. Well I took a quick glance at
NHibernate and got overwhelmed and decided to take a look at
SubSonic as I have heard a lot of good things about it. Well I am happy to say I doubt I will EVER do database access by hand ever again if I can help it. As such I figured I would make a code post on some
SubSonic code. I am not really going to explain it just want to show you how easy, cool and simple it is. I'll show the code starting with my .aspx main aspx page code, the code behind then the data access layer code.
I am also including the project I used too. Be sure you have Northwind database.
I suggest you download, install, and start using SubSonic. It is a great framework to help generate and create your DAL. Once you have it I suggest you watch the screencast on the using the Query Tool. If you would like me to explain this code i'd be more than happy to just let me know and I'll make another post.
SubSonicTest.zip (188.54 kb)
Short answer: No.
Here is how I got there and why I think it isn't bad.
First, I want to start off with 2 of my major goals in life then an analogy. Afterwards I will tie it all together with regards to the Microsoft MVP award.
Goals:
Learn everything and help as many people as I can learn what I know. Think about it you know you can't learn everything but you set your goal to learn everything imagine how much you can learn if you fall just short. You will probably learn quite a bit.
Analogy:
If a person is going to run 5 miles no matter what. Is it wrong for him to set a side goal of getting 1000 dollars if it is available. To me no there isn't anything wrong since he is going to run no matter what. (just imagine for a moment strictly running for money is bad)
Now I am sure some of you are going huh about now. Here is how I look at having a goal of earning the MVP award. I am going to help the community no matter what. I have been doing so for 4 years and will continue to do so for as long as I am able. Some of the things I have done and do are:
Blog
Attend DNUG meetings
Speak at DNUG meetings
Work on staff at Conference
Help Organize Dev Conference
Post on forums
Those are some of what I do to help, have done for a while and will continue to do them because I enjoy it.
So, if I am going to do the above in order to obtain my original 2 goals above then I don't see a problem in having a side goal of earning MVP award if it is available. For me the first two goals are most important over all others (within the non-political, non-religious, and non-family context).
Now some have said that the MVP isn't in my control so it isn't a very good goal to have. I have to disagree to an extent. Earning MVP may not totally be in your control, but there are things you can do so that it doesn't go the way of a dream. To me a dream is something that would be nice, but isn't what you are going to pour your heart and soul into doing or getting. Like going to space is a dream for me. It would be nice, but I am not going to spend the time to do it (I'll wait until it is affordable). Compared to that there is an amount of control in earning MVP, by helping the community. Earning the MVP isn't all up to you, but you don't have to keep it in the same realm as going to space.
In the end to me if earning MVP isn't your primary goal then having it as a goal, namely side goal, isn't bad at all. If it is a primary goal then I suggest re-assessing what you are doing and why because that is a lot of work for the chance of it not happening. If the primary goal is helping others in the community and teaching; then by all means a side goal of MVP is not a bad thing.
Please let me know what you think especially if you don't agree with me. Please, let me know how I am wrong if I am.
EDIT: Just wanted to note that I am NOT and MVP, but want to become one.
I just want to say welcome to my new ASP.NET blog. I have been blogging since 2004 over at BuddyLindsey.com, and will continue to. Back then I tried hard to get a blog here, but to no avail. It has been one of my goals to be able to blog here with some of the other great bloggers on the asp.net site.
What I blog about usually is doing beginner content. Things that people normally "assume" other people know I blog about it because often times beginners don't know what people should know. I also like to blog so that I can learn new things because it gives me an avenue to write about what I have learned so I can put into words and text to better understand what is going on. I also like to to receive feedback so please feel free to comment and leave suggestions to help me out.
Just to let you know I will be cross posting my asp.net posts on BuddyLindsey.com and here. Please feel free to read some of my posts on my other blog. Here are some of the higher traffic posts.
TDD Series
Part 1: TDD Test Driven Development for Beginners pt1
Part 2: TDD for Beginners pt2 - Pig Latin
Part 3: TDD for Beginners pt3 - The Application
Part 4: TDD for Beginners pt4 - Unit Tests
XML Series
Part 1: Write to XML File Using C#
Part 2: Reading Data from XML File Using C#
Part 3: Delete Data from XML File Using C#
Others
Hello World of Rhino Mocks
Real World Interfaces in C#
SQL Parameters in C#
Please let me know what you think and if there are any topics you want to know about.
More Posts