Click here to Skip to main content
15,904,652 members
Home / Discussions / C#
   

C#

 
Questionerror in crystal reports Pin
User349027-Mar-13 13:36
User349027-Mar-13 13:36 
AnswerRe: error in crystal reports Pin
Abhinav S27-Mar-13 17:58
Abhinav S27-Mar-13 17:58 
AnswerRe: error in crystal reports Pin
V.27-Mar-13 22:21
professionalV.27-Mar-13 22:21 
GeneralRe: error in crystal reports Pin
User349028-Mar-13 7:49
User349028-Mar-13 7:49 
GeneralRe: error in crystal reports Pin
V.28-Mar-13 8:19
professionalV.28-Mar-13 8:19 
QuestionHow to Async download multiple files using webclient simultaneously? Pin
Tridip Bhattacharjee27-Mar-13 8:01
professionalTridip Bhattacharjee27-Mar-13 8:01 
QuestionScreenshots -> Video file Pin
ADASD33333227-Mar-13 4:06
ADASD33333227-Mar-13 4:06 
AnswerRe: Screenshots -> Video file Pin
Abhinav S29-Mar-13 4:00
Abhinav S29-Mar-13 4:00 
QuestionSaving Screensaver in C# Pin
greylakota27-Mar-13 3:34
greylakota27-Mar-13 3:34 
QuestionRe: Saving Screensaver in C# Pin
Richard MacCutchan27-Mar-13 3:56
mveRichard MacCutchan27-Mar-13 3:56 
AnswerRe: Saving Screensaver in C# Pin
Dave Kreskowiak27-Mar-13 4:05
mveDave Kreskowiak27-Mar-13 4:05 
GeneralRe: Saving Screensaver in C# Pin
Richard MacCutchan27-Mar-13 5:04
mveRichard MacCutchan27-Mar-13 5:04 
QuestionC# progress failed! Pin
ccahe27-Mar-13 2:37
ccahe27-Mar-13 2:37 
AnswerRe: C# progress failed! Pin
Dave Kreskowiak27-Mar-13 4:02
mveDave Kreskowiak27-Mar-13 4:02 
AnswerRe: C# progress failed! Pin
ccahe27-Mar-13 22:02
ccahe27-Mar-13 22:02 
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 

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.