I am facing a problem related to variable scope please suggest me a good solution for this problem.
Error: temp dose not exist in current context.
if (cause_list_type_fk == 1)
{
Regularcause temp = (Regularcause) obj;
}
else if (cause_list_type_fk == 2)
{
urgentcauselist temp = (urgentcauselist) obj;
}
else
{
supplementryTable temp = (supplementryTable)obj;
}
//
// loging info to a file
//
using (StreamWriter w = System.IO.File.AppendText(@"D:\log-entriesSupply.txt"))
{
string tmp = "-->Hearing id: " + hearing_id + "-->bench id: " + bench_id + "-->pary id: " + party_id + "\n";
Log(tmp + "-->case_id= " + case_id + "-->= " + temp.caseno + "-->temp.Id= " + temp.Id, w);
w.Close();
}