Click here to Skip to main content
15,895,740 members
Home / Discussions / C#
   

C#

 
Questionsettings file in relaunching the application Pin
KRISHNARAYALU27-Mar-13 1:24
KRISHNARAYALU27-Mar-13 1:24 
AnswerRe: settings file in relaunching the application Pin
Richard MacCutchan27-Mar-13 3:53
mveRichard MacCutchan27-Mar-13 3:53 
GeneralRe: settings file in relaunching the application Pin
KRISHNARAYALU27-Mar-13 7:39
KRISHNARAYALU27-Mar-13 7:39 
GeneralRe: settings file in relaunching the application Pin
Richard MacCutchan27-Mar-13 7:46
mveRichard MacCutchan27-Mar-13 7:46 
GeneralRe: settings file in relaunching the application Pin
KRISHNARAYALU27-Mar-13 17:05
KRISHNARAYALU27-Mar-13 17:05 
GeneralRe: settings file in relaunching the application Pin
Richard MacCutchan27-Mar-13 23:58
mveRichard MacCutchan27-Mar-13 23:58 
QuestionC# Convertion Pin
Midnight Ahri26-Mar-13 17:20
Midnight Ahri26-Mar-13 17:20 
AnswerRe: C# Convertion PinPopular
parths26-Mar-13 21:08
parths26-Mar-13 21:08 
Midnight Ahri wrote:
txtValue = (string)a;

The typecast operation assumes that the object is of type or subclasses from the target type.
So in the above statement a is assumes needs to have string in it's inheritance hierarchy
You should try the above statement in your C# IDE. If 'a' is of type int or float (or anything non-string), the compiler throws an error since it would be a invalid typecast.


Midnight Ahri wrote:
txtValue = a.ToString();

a.ToString call the ToString method that every class inherits from the System.Object[^] class. It does not typecast, it returns a new string representation.
a.ToString would throw a null reference exception if a is null


Midnight Ahri wrote:
txtValue = Convert.ToString(a);

Convert.ToString[^] returns String.Empty in case the object passed to it is null, otherwise it first checks for IConvertible and IFormattable ToString implementations in the object and uses them. Finally if those are it functions the same as the object's ToString.


"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman

"Philosophy is a study that lets us be unhappy more intelligently."
-Anon.



GeneralRe: C# Convertion Pin
OriginalGriff26-Mar-13 21:21
mveOriginalGriff26-Mar-13 21:21 
GeneralRe: C# Convertion Pin
parths26-Mar-13 21:28
parths26-Mar-13 21:28 
GeneralRe: C# Convertion Pin
OriginalGriff26-Mar-13 21:34
mveOriginalGriff26-Mar-13 21:34 
GeneralRe: C# Convertion Pin
parths26-Mar-13 21:45
parths26-Mar-13 21:45 
AnswerRe: C# Convertion Pin
Midnight Ahri26-Mar-13 22:08
Midnight Ahri26-Mar-13 22:08 
GeneralRe: C# Convertion Pin
harold aptroot27-Mar-13 0:28
harold aptroot27-Mar-13 0:28 
AnswerRe: C# Convertion Pin
OriginalGriff26-Mar-13 21:33
mveOriginalGriff26-Mar-13 21:33 
GeneralRe: C# Convertion Pin
Richard MacCutchan26-Mar-13 22:54
mveRichard MacCutchan26-Mar-13 22:54 
GeneralRe: C# Convertion Pin
OriginalGriff26-Mar-13 22:57
mveOriginalGriff26-Mar-13 22:57 
GeneralRe: C# Convertion Pin
Keith Barrow26-Mar-13 23:51
professionalKeith Barrow26-Mar-13 23:51 
AnswerRe: C# Convertion Pin
V.26-Mar-13 22:29
professionalV.26-Mar-13 22:29 
QuestionLinq To SQL Left Join Pin
Kevin Marois26-Mar-13 17:01
professionalKevin Marois26-Mar-13 17:01 
AnswerRe: Linq To SQL Left Join Pin
Simon_Whale26-Mar-13 23:19
Simon_Whale26-Mar-13 23:19 
Questionserialization / type cast differs between service and console execution Pin
JudyL_MD26-Mar-13 14:20
JudyL_MD26-Mar-13 14:20 
GeneralRe: serialization / type cast differs between service and console execution Pin
JudyL_MD26-Mar-13 14:22
JudyL_MD26-Mar-13 14:22 
AnswerRe: serialization / type cast differs between service and console execution Pin
Dave Kreskowiak26-Mar-13 14:39
mveDave Kreskowiak26-Mar-13 14:39 
QuestionRe: serialization / type cast differs between service and console execution Pin
JudyL_MD26-Mar-13 15:13
JudyL_MD26-Mar-13 15:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.