New C#, how do I find a roadmap for navigating through objects/collections?
Ok, so I'm new to C# Windows App development coming from ColdFusion, PHP, Javascript. I'm picking up on it fairly well I think. I'm understanding the base concepts of OO and how they're implemented in C#, but I'm struggling more with learning how to find what I'm looking for and what's available to me in objects, methods, collections, etc.
For instance. I have a dataview (named "drawing") and I want to filter it using RowFilter, so I do that:
drawing.RowFilter = "partNo = '" + partNo + "'";
As a beginner, how do I know how to access a specific field of data in that dataview now? I finally fumbled around and was able to do it 2 different ways:
drawing[0].Row.ItemArray[0]
or
drawing[0][0]
My question is this: How do I do less fumbling and more understanding and navigating...essentially PRODUCTIVITY and less guessing!? I've read through Visual C# .NET step-by-step and开发者_运维技巧 Apress' Beginning C# OO, but neither of them seem to tell me how to navigate the language like this or gives this detail. That means it's just a matter of getting lucky rather than understanding, which seems like a huge waste of time. I know understanding will come with time and experience, but there's got to be a better method for learning. Either that or there is a gap of fundemental understanding at a foundational level, and if that's the case, what is it?
So how would I know to find the value of a field in a dataview at: "dataview"[index].Row.ItemArray[index]?
I don't see it in the books I have and I can't seem to find it mapped out on the msdn site: http://msdn.microsoft.com/en-us/library/01s96x0z.aspx
Am I just wishful thinking?
My question is this: How do I do less fumbling and more understanding and navigating...essentially PRODUCTIVITY and less guessing!?
As is the case with any language, you read the documentation
Well I finally found what I was looking for!!!!
The The Object Browser in Visual Studio!!
I was able to open the Dataview class and drill down all the way to the ItemArray! It went like this:
DataView *this[int]* which returned a...
> DataRowView which had the *Row* property which returns a...
> DataRow which finally has the *ItemArray* object!!
Winner Winner Chicken Dinner!!!
精彩评论