Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
VulpesRank #55 · 29.2K reputationPosted May 31, 2012, 8:56 AM EDT
Jaish MathewsRank #225 · 11K reputationPosted May 31, 2012, 3:00 AM EDT
Samio170 reputationPosted May 31, 2012, 3:54 AM EDT
In my connection form I have this:
using (EntityConnection conn = new EntityConnection(Global.Cnx))
{
conn.Open();
using (var ctx = new Entities(conn))
{
var qry = ...
}
conn.Close();
}
I need to use ctx in the whole project, how can I declare it as Global since public static var is not accepted.
it is there a disadvantage in terms of safety and performance if it is used in this way.
Samio170 reputationPosted May 31, 2012, 9:32 AM EDT