private void _backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            string sqlScript = "";

            IsLoading = true;

            sqlScript = ScriptTableSchema();

            DataSet ds = new DataSet();

            ds = SelectedDB.ExecuteWithResults(GetTableSelectStatement());

            TableData = ds;

            e.Result = sqlScript;
        }
        private void LoadTableData()
        {
            IsLoading = true;

            StringBuilder sb = new StringBuilder();

            ScriptingOptions options = new ScriptingOptions();

            options.NoCollation        = true;
            options.ClusteredIndexes   = true;
            options.Default            = true;
            options.DriAll             = true;
            options.Indexes            = true;
            options.IncludeHeaders     = true;
            options.IncludeIfNotExists = true;
            options.Triggers           = true;
            options.SchemaQualify      = true;

            StringCollection coll = SelectedTable.Script(options);

            foreach (string str in coll)
            {
                sb.Append(str);
                sb.Append(Environment.NewLine);
            }
            sb.AppendLine("GO");

            SQLScript = sb.ToString();

            DataSet ds = new DataSet();

            ds = SelectedDB.ExecuteWithResults(GetTableSelectStatement());

            TableData = ds;
            var     results = ds.Tables[0].Select().Skip(2).Take(50).ToList <object>();
            DataRow tmp     = results[5] as DataRow;

            IsLoading = false;
        }