Beispiel #1
0
        /// <summary>
        /// Списък на таблиците
        /// </summary>
        public List <string> GetTables()
        {
            List <string> listTables = null;

            using (SqlConnection sqlConnection = DBUtilsMSSQL.OpenConnection(_ConnectionString))
            {
                listTables = GetTables(sqlConnection);
                sqlConnection.Close();
            }
            return(listTables);
        }
Beispiel #2
0
        /// <summary>
        /// Списък на колонките в таблицата
        /// </summary>
        public List <DBTableColumn> GetTableColumns(string tableName)
        {
            List <DBTableColumn> listTables = null;

            using (SqlConnection sqlConnection = DBUtilsMSSQL.OpenConnection(_ConnectionString))
            {
                listTables = GetTableColumns(sqlConnection, tableName);
                sqlConnection.Close();
            }
            return(listTables);
        }
Beispiel #3
0
        public void FillTable(DataTable table, string columns, string tableName)
        {
            if (columns == "")
            {
                return;
            }
            if (tableName == "")
            {
                return;
            }

            string commandText =
                "SELECT " + columns +
                " FROM " + tableName;

            using (SqlConnection sqlConnection = DBUtilsMSSQL.OpenConnection(_ConnectionString))
            {
                DBUtilsMSSQL.Fill(table, commandText, sqlConnection);
                sqlConnection.Close();
            }
        }