Click here to Skip to main content
15,886,799 members
Home / Discussions / C#
   

C#

 
QuestionImplementing database roles on menu and button level Pin
DotNetXenon19-Jul-10 6:30
DotNetXenon19-Jul-10 6:30 
AnswerRe: Implementing database roles on menu and button level Pin
Pete O'Hanlon19-Jul-10 6:49
mvePete O'Hanlon19-Jul-10 6:49 
GeneralRe: Implementing database roles on menu and button level Pin
DotNetXenon19-Jul-10 8:13
DotNetXenon19-Jul-10 8:13 
GeneralRe: Implementing database roles on menu and button level Pin
Pete O'Hanlon19-Jul-10 9:49
mvePete O'Hanlon19-Jul-10 9:49 
QuestionHow can you add a click event in the text box, C# , asp.net Pin
emmadahmad19-Jul-10 6:19
emmadahmad19-Jul-10 6:19 
AnswerRe: How can you add a click event in the text box, C# , asp.net Pin
Pete O'Hanlon19-Jul-10 6:40
mvePete O'Hanlon19-Jul-10 6:40 
AnswerRe: How can you add a click event in the text box, C# , asp.net Pin
brunoseixas19-Jul-10 6:56
brunoseixas19-Jul-10 6:56 
QuestionDeclaring variables inside loops - inefficient? Pin
Adam Brown 319-Jul-10 5:19
Adam Brown 319-Jul-10 5:19 
Is there any efficiency lost in declaring variables inside loops, or is the compiler smart enough to optimize the code so the variable is really only reserved once? For example, would it be more efficient to move the variable declaratrions outrside of the loops?

Example 1

for (int i = 0; i < tblApplications.Controls.Count; i++) { ... }


Is it more efficient to write it like this:

int i;
for (i = 0; i &lt; tblApplications.Controls.Count; i++) { ... }


Example 2

foreach (GridViewRow row in grdUsers.Rows)
{
    string value= row.Cells[1].Text;
}


Is it more efficient to write it like this:

GridViewRow row;
string value;
foreach (row in grdUsers.Rows)
{
    value= row.Cells[1].Text;
}

AnswerRe: Declaring variables inside loops - inefficient? Pin
riced19-Jul-10 5:27
riced19-Jul-10 5:27 
AnswerRe: Declaring variables inside loops - inefficient? Pin
harold aptroot19-Jul-10 5:29
harold aptroot19-Jul-10 5:29 
AnswerRe: Declaring variables inside loops - inefficient? Pin
Ennis Ray Lynch, Jr.19-Jul-10 5:35
Ennis Ray Lynch, Jr.19-Jul-10 5:35 
AnswerRe: Declaring variables inside loops - inefficient? Pin
Luc Pattyn19-Jul-10 5:37
sitebuilderLuc Pattyn19-Jul-10 5:37 
AnswerRe: Declaring variables inside loops - inefficient? Pin
Keith Barrow19-Jul-10 5:44
professionalKeith Barrow19-Jul-10 5:44 
GeneralRe: Declaring variables inside loops - inefficient? Pin
Adam Brown 319-Jul-10 5:53
Adam Brown 319-Jul-10 5:53 
GeneralRe: Declaring variables inside loops - inefficient? Pin
harold aptroot19-Jul-10 5:54
harold aptroot19-Jul-10 5:54 
GeneralRe: Declaring variables inside loops - inefficient? [modified] Pin
Keith Barrow19-Jul-10 6:05
professionalKeith Barrow19-Jul-10 6:05 
GeneralRe: Declaring variables inside loops - inefficient? Pin
harold aptroot19-Jul-10 6:18
harold aptroot19-Jul-10 6:18 
GeneralRe: Declaring variables inside loops - inefficient? Pin
Keith Barrow19-Jul-10 6:35
professionalKeith Barrow19-Jul-10 6:35 
GeneralRe: Declaring variables inside loops - inefficient? Pin
harold aptroot19-Jul-10 6:52
harold aptroot19-Jul-10 6:52 
GeneralRe: Declaring variables inside loops - inefficient? Pin
Luc Pattyn19-Jul-10 6:52
sitebuilderLuc Pattyn19-Jul-10 6:52 
GeneralRe: Declaring variables inside loops - inefficient? Pin
Pete O'Hanlon19-Jul-10 6:54
mvePete O'Hanlon19-Jul-10 6:54 
AnswerRe: Declaring variables inside loops - inefficient? Pin
Luc Pattyn19-Jul-10 7:04
sitebuilderLuc Pattyn19-Jul-10 7:04 
Questionreading weather.com data feed Pin
Jassim Rahma19-Jul-10 5:07
Jassim Rahma19-Jul-10 5:07 
AnswerRe: reading weather.com data feed Pin
Eddy Vluggen19-Jul-10 5:20
professionalEddy Vluggen19-Jul-10 5:20 
AnswerRe: reading weather.com data feed Pin
brunoseixas19-Jul-10 6:58
brunoseixas19-Jul-10 6:58 

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.