Click here to Skip to main content
15,899,679 members
Home / Discussions / C#
   

C#

 
GeneralRe: About ReportViewer in c# Pin
Davood Riazi14-Nov-07 4:35
Davood Riazi14-Nov-07 4:35 
GeneralRe: About ReportViewer in c# Pin
Justin Perez14-Nov-07 4:51
Justin Perez14-Nov-07 4:51 
GeneralRe: About ReportViewer in c# Pin
Justin Perez14-Nov-07 4:51
Justin Perez14-Nov-07 4:51 
QuestionDataSet XML Pin
jamesorm14-Nov-07 3:17
jamesorm14-Nov-07 3:17 
AnswerRe: DataSet XML Pin
Justin Perez14-Nov-07 4:43
Justin Perez14-Nov-07 4:43 
GeneralRe: DataSet XML Pin
jamesorm14-Nov-07 5:13
jamesorm14-Nov-07 5:13 
QuestionC# - Implicitly typed local variables Pin
Michael Sync14-Nov-07 3:16
Michael Sync14-Nov-07 3:16 
AnswerRe: C# - Implicitly typed local variables Pin
Colin Angus Mackay14-Nov-07 4:27
Colin Angus Mackay14-Nov-07 4:27 
Michael Sync wrote:
Why do we need "Implicitly typed local variables" (similar to "var" in JS)? Is it created especially for LINQ?? If LINQ is not used in the application, this kinda variable won't be required anymore, isn't it?


It is not similar to var in js. A var in C# remains one type throughout once set.

var a = 5;
a = "five"; // This will throw a compiler error

Its inclusion is mainly to support LINQ. It is also required if you are using another new features called anonymous types. (What do you declare the reference if the type is anonymous)


Michael Sync wrote:
Let's say I wrote like that "var myvar = 1;". then, C# compiler will assume my variable "myvar" is int, right? Actually, I declared it as long.. What about "int vs uint", "long vs ulong" and "double vs float vs decimal"??


You probably wouldn't use it in those situations. It wasn't what is is designed for. The only time is is REQUIRED is for anonymous types.

If you know the type then use the type.

Michael Sync wrote:
What do you think?


I think it is something that I'll use from time to time when I need to use an anonymous type. However, if I know the type then I'll use the type. It is as simple as that.

However, I can forsee a lot of people getting it wrong then getting confused and asking questions about why they can't pass their variable into other methods or return it from a method.


Upcoming FREE developer events:
* Glasgow: SQL Server Managed Objects AND Reporting Services ...

My website

GeneralRe: C# - Implicitly typed local variables Pin
Michael Sync14-Nov-07 15:40
Michael Sync14-Nov-07 15:40 
AnswerRe: C# - Implicitly typed local variables Pin
Skippums14-Nov-07 4:33
Skippums14-Nov-07 4:33 
GeneralRe: C# - Implicitly typed local variables Pin
Colin Angus Mackay14-Nov-07 5:33
Colin Angus Mackay14-Nov-07 5:33 
GeneralRe: C# - Implicitly typed local variables Pin
Michael Sync14-Nov-07 15:53
Michael Sync14-Nov-07 15:53 
AnswerRe: C# - Implicitly typed local variables Pin
Guffa14-Nov-07 7:52
Guffa14-Nov-07 7:52 
GeneralRe: C# - Implicitly typed local variables Pin
Michael Sync14-Nov-07 15:51
Michael Sync14-Nov-07 15:51 
QuestionAdobe PDF Pin
smarttom9914-Nov-07 3:12
smarttom9914-Nov-07 3:12 
QuestionReportViewer Properties in C# Pin
Davood Riazi14-Nov-07 3:10
Davood Riazi14-Nov-07 3:10 
AnswerRe: ReportViewer Properties in C# Pin
Abhijit Jana14-Nov-07 3:15
professionalAbhijit Jana14-Nov-07 3:15 
GeneralRe: ReportViewer Properties in C# Pin
Davood Riazi14-Nov-07 3:42
Davood Riazi14-Nov-07 3:42 
QuestionExceptions in Appdomain Pin
prasuaaron14-Nov-07 2:29
prasuaaron14-Nov-07 2:29 
QuestionC# Form and Mozilla engine Pin
springtime5414-Nov-07 2:11
springtime5414-Nov-07 2:11 
QuestionUploading Excell file to FTP Pin
Reddy Prakash14-Nov-07 1:25
Reddy Prakash14-Nov-07 1:25 
AnswerRe: Uploading Excell file to FTP Pin
Giorgi Dalakishvili14-Nov-07 1:29
mentorGiorgi Dalakishvili14-Nov-07 1:29 
GeneralRe: Uploading Excell file to FTP Pin
Reddy Prakash14-Nov-07 1:48
Reddy Prakash14-Nov-07 1:48 
AnswerRe: Uploading Excell file to FTP Pin
Guffa14-Nov-07 3:43
Guffa14-Nov-07 3:43 
GeneralRe: Uploading Excell file to FTP Pin
Reddy Prakash14-Nov-07 17:01
Reddy Prakash14-Nov-07 17:01 

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.