would like to know,
is it better to put a connectionstring (called from a static method from another class) into a string variable, and pass the string to the methods, or get the connectionstring (call the static method) in every methods that requires it?
//==================================
//SAMPLE 1
//==================================
public static void Main()
{
string strConn = ConnectionString.GetConnectionString();
AA(strConn);
if (VV())
{
BB(strConn);
}
}
//=================================
//SAMPLE 2
//=================================
public static void Main()
{
Preprocessing();
if (VV())
{
PopulateUIData();
}
}
private static void AA()
{
string strConn = ConnectionString.GetConnectionString();
}
private static void BB()
{
string strConn = ConnectionString.GetConnectionString();
2007-01-01
17:17:12
·
3 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design