Carrotware.CMS.DBUpdater.DatabaseUpdate.GetDataTable C# (CSharp) Method

GetDataTable() private static method

private static GetDataTable ( string sConnectionString, string sSQLQuery ) : DataTable
sConnectionString string
sSQLQuery string
return System.Data.DataTable
        private static DataTable GetDataTable(string sConnectionString, string sSQLQuery)
        {
            DataTable dt = new DataTable();

            using (SqlConnection cn = new SqlConnection(sConnectionString)) {
                using (SqlCommand cmd = new SqlCommand(sSQLQuery, cn)) {
                    cn.Open();
                    cmd.CommandType = CommandType.Text;
                    using (SqlDataAdapter da = new SqlDataAdapter(cmd)) {
                        da.Fill(dt);
                    }
                    cn.Close();
                }
            }

            return dt;
        }

Same methods

DatabaseUpdate::GetDataTable ( string sSQLQuery ) : DataTable