Raj De Inno Raj De Inno - 12 days ago 6
C# Question

Name doesnot exist in the current context error in c#

I have 2 methods in my class. I call

selectAll
method in
GetDb
. when I put a break point in
selectAll
method, I can see the values return in var all. Yet, when I go and find in the
GetDb
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

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

Comments