This is not a problem, but I'm curious. When I store a string in let, say, a DataRow, it is passed to the object. When I want to use it, I have to use its ToString. As far as I know, there are several ways to do this, first
string name = (string)DataRowObject["name"];
and the other:
string name = DataRowObject["name"].ToString();
I'm interested in what is the difference between the two? Is the first one more efficient? (This is just an assumption; in my head, the ToString () method is implemented by some kind of loop mechanism in which only "casting" can "be faster, but it's just the" gut feeling "that I have).
Is there an even faster / more elegant way to do this?
Can anyone clarify this for me?
string casting c # parsing
David BoΕΎjak Jul 23 '09 at 9:58 2009-07-23 09:58
source share