示例#1
0
 internal int GetSize(DatabaseFile databaseFile)
 {
     return((int)DataAccess.GetScalar(ConnectionString,
                                      Name,
                                      Properties.Resources.SQL_File_Size,
                                      CommandType.Text,
                                      new SqlParameter[1] {
         new SqlParameter("file_id", databaseFile.FileId)
     }));
 }
示例#2
0
        private void LoadFiles()
        {
            var sqlCommand = Properties.Resources.SQL_Files;

            var filesDataTable = DataAccess.GetDataTable(ConnectionString, sqlCommand, Name, "Files", CommandType.Text);

            foreach (DataRow r in filesDataTable.Rows)
            {
                var file = new DatabaseFile((int)r["file_id"], this);

                file.FileGroup    = r["filegroup_name"].ToString();
                file.Name         = r["name"].ToString();
                file.PhysicalName = r["physical_name"].ToString();
                file.Size         = (int)r["size"];
                file.TotalExtents = (int)r["total_extents"];
                file.UsedExtents  = (int)r["used_extents"];

                Files.Add(file);
            }
        }