Raj De Inno Raj De Inno - 1 year ago 88
C# Question

Name doesnot exist in the current context error in c#

I have 2 methods in my class. I call

method in
. when I put a break point in
method, I can see the values return in var all. Yet, when I go and find in the
method, var list is not demonstrating the values. Truth be told it is not tossing errors moreover. When I go and find in Quick watch it is saying that:

The name 'list' does not exist in the current context.

Am I missing anything here? Anyhelp would be really appriciated..

Here is my code:

private void GetDb()
var list = selectAll();

public List<ticketinfo> selectAll()
var all = db.ticketinfoes.Where(x => x.TaskType == "WINDOWSADMIN").ToList();
return all;

Answer Source

I was running my program in release mode. When I change the mode release to debug, It works fine.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download