I use the following code..the code runs properly..but i can't understand the code.can any one explain me.
using System;
using System.Data.SqlClient;
using System.Data;
using SQL_Tuner;
using AMS.Profile;
namespace SQL_Tuner
{
public class DataBase
{
clsGlobal C1= new clsGlobal();
public DataTable GetDatabases()
{
DataTable dt = null;
if (dt == null)
{
clsGlobal.sServer = clsGlobal.sgBOSetup.GetValue("CONNECTION", "SERVER").ToString();
clsGlobal.sUsername = clsGlobal.sgBOSetup.GetValue("CONNECTION", "USERNAME").ToString();
clsGlobal.sPassword = clsGlobal.sgBOSetup.GetValue("CONNECTION", "PASSWORD").ToString();
clsGlobal.sDatabase = clsGlobal.sgBOSetup.GetValue("CONNECTION", "DATABASE").ToString();
SqlDBHandler db = new SqlDBHandler(clsGlobal.sServer, clsGlobal.sDatabase, clsGlobal.sUsername, clsGlobal.sPassword);
try
{
dt = db.ExecDT ("sp_helpdb");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
return dt;
}
}
}