Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 20 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
20
Dung lượng
3,07 MB
Nội dung
[ Team LiB ] Recipe 2.16 Mapping Table and Column Names Between the Data Source and DataSet Problem You want to control the names assigned to tables and columns when you fill a DataSet using a DataAdapter. Solution Use DataTableMapping and DataColumnMapping objects to map the names of database tables and columns in the data source to different names in a DataSet when using a DataAdapter. The sample code defines a SQL statement to retrieve the CategoryID, CategoryName, and Description columns from the Categories table in Northwind. A DataAdapter is created with a DataTableMapping object to map the database table name Categories to the name tblmapCategories in the DataSet. Three DataColumnMapping objects are created to map the database column names to different names in the table in the DataSet. The DataAdapter is used to fill a new DataSet. Finally, the default view of the mapped Categories table is bound to the data grid on the form. The C# code is shown in Example 2-21 . Example 2-21. File: MappingsForm.cs // Namespaces, variables, and constants using System; using System.Configuration; using System.Data; using System.Data.Common; using System.Data.SqlClient; // . . . // Create the DataAdapter. String sqlText = "SELECT CategoryID, CategoryName, Description " + "FROM Categories"; SqlDataAdapter da = new SqlDataAdapter(sqlText, ConfigurationSettings.AppSettings["Sql_ConnectString"]); // Create the table mapping to map the default table name 'Table'. DataTableMapping dtm = da.TableMappings.Add("Table", "tblmapCategories"); // Create thecolumn mappings for the Categories table. dtm.ColumnMappings.Add("CategoryID", "colmapCategoryID"); dtm.ColumnMappings.Add("CategoryName", "colmapCategoryName"); dtm.ColumnMappings.Add("Description", "colmapDescription"); // Create the DataSet and fill. DataSet ds = new DataSet( ); da.Fill(ds); // Retrieve and display the mapped name of the table as grid caption. dataGrid.CaptionText = "TableName: " + ds.Tables[0].ToString( ); // Bind the default view of the Categories table to the grid. dataGrid.DataSource = ds.Tables["tblmapCategories"].DefaultView; Discussion When the Fill( ) method of the DataAdapter is used to fill a DataSet, thecolumn names used in the DataSet default to thecolumn names defined in the data source. A DataAdapter has a collection of DataTableMapping objects in its DataTableMappingCollection accessed through its TableMappings property. These objects map the name of a table in the data source to a DataTable with different name in the DataSet. When a batch query is used to fill multiple tables within a DataSet, the table names default to Table, Table1, Table2, and so on. You can use table mapping to rename tables created within the DataSet to match the table names in theTheVertebralColumnTheVertebralColumn Bởi: OpenStaxCollege Thevertebralcolumn is also known as the spinal column or spine ([link]) It consists of a sequence of vertebrae (singular = vertebra), each of which is separated and united by an intervertebral disc Together, the vertebrae and intervertebral discs form thevertebralcolumn It is a flexible column that supports the head, neck, and body and allows for their movements It also protects the spinal cord, which passes down the back through openings in the vertebrae VertebralColumnThe adult vertebralcolumn consists of 24 vertebrae, plus the sacrum and coccyx The vertebrae are divided into three regions: cervical C1–C7 vertebrae, thoracic T1–T12 vertebrae, and lumbar L1–L5 vertebrae Thevertebralcolumn is curved, with two primary curvatures (thoracic and sacrococcygeal curves) and two secondary curvatures (cervical and lumbar curves) 1/20 TheVertebralColumn Regions of theVertebralColumnThevertebralcolumn originally develops as a series of 33 vertebrae, but this number is eventually reduced to 24 vertebrae, plus the sacrum and coccyx Thevertebralcolumn is subdivided into five regions, with the vertebrae in each area named for that region and numbered in descending order In the neck, there are seven cervical vertebrae, each designated with the letter “C” followed by its number Superiorly, the C1 vertebra articulates (forms a joint) with the occipital condyles of the skull Inferiorly, C1 articulates with the C2 vertebra, and so on Below these are the 12 thoracic vertebrae, designated T1–T12 The lower back contains the L1–L5 lumbar vertebrae The single sacrum, which is also part of the pelvis, is formed by the fusion of five sacral vertebrae Similarly, the coccyx, or tailbone, results from the fusion of four small coccygeal vertebrae However, the sacral and coccygeal fusions not start until age 20 and are not completed until middle age An interesting anatomical fact is that almost all mammals have seven cervical vertebrae, regardless of body size This means that there are large variations in the size of cervical vertebrae, ranging from the very small cervical vertebrae of a shrew to the greatly elongated vertebrae in the neck of a giraffe In a full-grown giraffe, each cervical vertebra is 11 inches tall Curvatures of theVertebralColumnThe adult vertebralcolumn does not form a straight line, but instead has four curvatures along its length (see [link]) These curves increase thevertebral column’s strength, flexibility, and ability to absorb shock When the load on the spine is increased, by carrying a heavy backpack for example, the curvatures increase in depth (become more curved) to accommodate the extra weight They then spring back when the weight is removed The four adult curvatures are classified as either primary or secondary curvatures Primary curves are retained from the original fetal curvature, while secondary curvatures develop after birth During fetal development, the body is flexed anteriorly into the fetal position, giving the entire vertebralcolumn a single curvature that is concave anteriorly In the adult, this fetal curvature is retained in two regions of thevertebralcolumn as the thoracic curve, which involves the thoracic vertebrae, and the sacrococcygeal curve, formed by the sacrum and coccyx Each of these is thus called a primary curve because they are retained from the original fetal curvature of thevertebralcolumn A secondary curve develops gradually after birth as the child learns to sit upright, stand, and walk Secondary curves are concave posteriorly, opposite in direction to the original fetal curvature The cervical curve of the neck region develops as the infant begins to hold their head upright when sitting Later, as the child begins to stand and then to walk, 2/20 TheVertebralColumnthe lumbar curve of the lower back develops In adults, the lumbar curve is generally deeper in females Disorders associated with the curvature of the spine include kyphosis (an excessive posterior curvature of the thoracic region), lordosis (an excessive anterior curvature of the lumbar region), and scoliosis (an abnormal, lateral curvature, accompanied by twisting of thevertebral column) Disorders of theVertebralColumn Developmental anomalies, pathological changes, or obesity can enhance the normal vertebralcolumn curves, resulting in the development of abnormal or excessive curvatures ([link]) Kyphosis, also referred to as humpback or hunchback, is an excessive posterior curvature of the thoracic region This can develop when osteoporosis causes weakening and erosion of the anterior portions of the upper thoracic vertebrae, resulting in their gradual collapse ([link]) Lordosis, or swayback, is an excessive anterior curvature of the lumbar region and is most commonly associated with obesity or late pregnancy The accumulation of body weight in the abdominal region results an anterior shift in the line of gravity that ... Using the Get* Methods to Read Column Values Before I show you the other Get* methods that read column values, you need to know the standard C# types and the values they support. You need to know these so that you can understand the type compatibilities between C# and SQL Server shown later. Table 9.3 shows the standard C# types, along with the underlying .NET type and the values that can be stored in the C# type. Table 9.3: STANDARD C# AND .NET TYPES C# TYPE .NET TYPE VALUES bool Boolean A Boolean true or false value. byte Byte An 8-bit unsigned integer between 0 and 2 8 - 1(255). char Char A 16-bit Unicode character. DateTime DateTime A date and time between 12:00:00 AM January 1, 0001 and 11:59:59 PM December 31, 9999. decimal Decimal A fixed precision and scale number between approximately +/-1.0 *10 -28 and approximately +/-7.9 *10 28 with 28 significant figures of precision. double Double A 64-bit floating-point number between approximately +/-5 *10 - 324 and approximately +/-1.7 *10 308 with 15 to 16 significant figures of precision. float Single A 32-bit floating-point number between approximately +/-1.5 *10 - 45 to approximately +/-3.4 *10 38 with 7 significant figures of precision. Guid Guid A 128-bit unsigned integer value (16 bytes) that that is unique across all computers and networks. int Int32 A 32-bit signed integer between -2 31 (-2,147,483,648) and 2 31 - 1 (2,147,483,647). long Int64 A 64-bit signed integer between -2 63 (- 9,223,372,036,854,775,808) and 2 63 - 1 (9,223,372,036,854,775,807). sbyte SByte An 8-bit signed integer between -2 7 (-128) and 2 7 - 1 (127). short Int16 A 16-bit signed integer between -2 15 (-32,768) and 2 15 - 1 (32,767). string String A variable-length string of 16-bit Unicode characters. Table 9.3: STANDARD C# AND .NET TYPES C# TYPE .NET TYPE VALUES uint UInt32 A 32-bit unsigned integer between 0 and 2 32 - 1 (4,294,967,295). ulong UInt64 A 64-bit unsigned integer between 0 and 2 64 - 1 (18,446,744,073,709,551,615). ushort UInt16 A 16-bit unsigned integer between 0 and 2 16 - 1 (65,535). Note The standard C# types are defined in the System namespace. Table 9.4 shows the SQL Server types, the compatible standard C# types, and the DataReader Get* methods that return each C# type. You use this table to figure out which method to call to get a specific column type. For example, if you need to get the value of a bigint column, you call the GetInt64() method that returns a long. Table 9.4: SQL SERVER TYPES, COMPATIBLE STANDARD C# TYPES, AND GET* METHODS SQL SERVER TYPE COMPATIBLE STANDARD C# TYPE GET* METHOD binary byte[] GetBytes() bigint long GetInt64() bit bool GetBoolean() char string GetString() datetime DateTime GetDateTime() decimal decimal GetDecimal() float double GetDouble() image byte[] GetBytes() int int GetInt32() money decimal GetDecimal() nchar string GetString() ntext string GetString() nvarchar string GetString() numeric decimal GetDecimal() real float GetFloat() smalldatetime DateTime GetDateTime() smallint short GetInt16() smallmoney decimal GetDecimal() Table 9.4: SQL SERVER TYPES, COMPATIBLE STANDARD C# TYPES, AND GET* METHODS SQL SERVER TYPE COMPATIBLE STANDARD C# TYPE GET* METHOD sql_varient object GetValue() text string GetString() timestamp byte[] GetBytes() tinyint byte GetByte() varbinary byte[] GetBytes() varchar string GetString() uniqueidentifier Guid GetGuid() Note You [ Team LiB ] Recipe 10.4 Determining the Length of Columns in a SQL Server Table Problem The FillSchema( ) method of the DataAdapter returns the correct length in the MaxLength property for string columns in a SQL Server database, but it returns -1 for the length of all other fields. You need to get the length of columns other than string type columns. Solution Use the system stored procedure sp_help. The sample code executes a batch query to return all rows from both the Orders and Order Details tables in the Northwind sample database. The extended stored procedure sp_help is used to get the length, precision, and scale of all columns in both tables. The C# code is shown in Example 10-4 . Example 10-4. File: ColumnSchemaForm.cs // Namespaces, variables, and constants using System; using System.Configuration; using System.Collections; using System.Text; using System.Data; using System.Data.SqlClient; // . . . StringBuilder schemaInfo = new StringBuilder( ); // Create a batch query to retrieve order and details. String sqlText = "select OrderID, CustomerID, EmployeeID, OrderDate, " + "RequiredDate, ShippedDate, ShipVia, Freight, ShipName, " + " ShipAddress, ShipCity, ShipRegion, ShipPostalCode, ShipCountry " + "FROM Orders;" + "SELECT OrderID, ProductID, UnitPrice, Quantity, Discount " + "FROM [Order Details];"; // Create the connection. SqlConnection conn = new SqlConnection( ConfigurationSettings.AppSettings["Sql_ConnectString"]); // Create DataAdapter. SqlDataAdapter da = new SqlDataAdapter(sqlText, conn); // Add table mappings. da.TableMappings.Add("Table", "Orders"); da.TableMappings.Add("Table1", "Order Details"); // Create the DataSet. DataSet ds = new DataSet( ); // Fill the schema and data. da.FillSchema(ds, SchemaType.Mapped); da.Fill(ds); // Iterate over the table collection in the DataSet. foreach(DataTable dt in ds.Tables) { schemaInfo.Append("TABLE: " + dt.TableName + Environment.NewLine); // Create the command to retrieve column information. cmd = new SqlCommand("sp_help", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@objname", SqlDbType.NVarChar, 776); cmd.Parameters[0].Value = dt.TableName; conn.Open( ); // Create the DataReader from the command. SqlDataReader dr = cmd.ExecuteReader( ); // Get the second result set containing column information. dr.NextResult( ); Hashtable colInfo = new Hashtable( ); // Iterate over the second result to retrieve column information. while(dr.Read( )) { colInfo.Add(dr["Column_name"].ToString( ), "Length = " + dr["Length"] + "; Precision = " + dr["Prec"] + "; Scale = " + dr["Scale"]); } dr.Close( ); conn.Close( ); // Iterate over thecolumn collection in the table. foreach(DataColumn col in dt.Columns) { // Get column information. A Macdonald Vertex Operator and Standard Tableaux Statistics for the Two-Column (q, t)-Kostka Coefficients Mike Zabrocki Centre de Recherche Math´ematiques, Universit´e de Montr´eal/LaCIM, Universit´edeQu´ebec `aMontr´eal email: zabrocki@math.ucsd.edu Submitted: September 30, 1998; Accepted: November 2, 1998 MR Subject Number: 05E10 Keywords: Macdonald polynomials, tableaux, symmetric functions, q,t-Kostka coefficients Abstract The two parameter family of coefficients K λµ (q, t) introduced by Macdonald are conjectured to (q, t) count the standard tableaux of shape λ. If this conjecture is cor- rect, then there exist statistics a µ (T )andb µ (T) such that the family of symmetric functions H µ [X; q, t]= λ K λµ (q, t)s λ [X] are generating functions for the standard tableaux of size |µ| in the sense that H µ [X; q, t]= T q a µ (T) t b µ (T) s λ(T) [X] where the sum is over standard tableau of of size |µ|. We give a formula for a symmetric func- tion operator H qt 2 with the property that H qt 2 H (2 a 1 b ) [X; q, t]=H (2 a+1 1 b ) [X; q, t]. This operator has a combinatorial action on the Schur function basis. We use this Schur function action to show by induction that H (2 a 1 b ) [X; q, t] is the generating function for standard tableaux of size 2a + b (and hence that K λ(2 a 1 b ) (q, t)isapolynomialwith non-negative integer coefficients). The inductive proof gives an algorithm for ’building’ the standard tableaux of size n + 2 from the standard tableaux of size n and divides the standard tableaux into classes that are generalizations of the catabolism type. We show that reversing this construction gives the statistics a µ (T )andb µ (T)whenµis of the form (2 a 1 b ) and that these statistics prove conjectures about the relationship between adjacent rows of the (q, t)-Kostka matrix that were suggested by Lynne Butler. 1 the electronic journal of combinatorics 5 (1998), #R45 2 1 Introduction The Macdonald basis for the symmetric functions generalizes many other bases by special- izing the values of t and q. The symmetric function basis {P µ [X; q,t]} µ is defined ([14] p. 321) as being self-orthogonal and having an upper triangularity condition with the mono- mial symmetric functions and the integral form of the basis is defined by setting J µ [X; q,t]= P µ [X;q,t]h µ (q, t) for some q,t-polynomial coefficients h µ (q, t). The {J µ [X; q, t]} µ have the expansion J µ [X; q,t]= λ K λµ (q, t)S λ [X; t] where S λ [X; t] is the dual Schur basis. The coefficients K λµ (q, t) are referred to as the Macdonald (q, t)-Kostka coefficients. These coefficients are known to be polynomials and conjectured to have non-negative integer coefficients. It is known that K λµ (1, 1) = K λ and so it is conjectured that these coefficients (q, t) count the standard tableau of shape λ. We are interested here in the basis H µ [X; q,t]= λ K λµ (q, t)s λ [X] It has the specializations that H µ [X;0,t]=H µ [X;t] (the Hall-Littlewood basis of symmetric functions), H µ [X;0,0] = s µ [X], H µ [X;0,1] = h µ [X], and the property that H µ [X; q,t]= q n(µ ) t n(µ) ωH µ [X;1/q, 1/t]andH µ [X;q, t]=ωH µ [X;t, q]. For each of the homogeneous, Schur, and Hall-Littlewood symmetric functions there are vertex operators with the property that for m ≥ µ 1 h m h µ [X]=h (m,µ) [X], S m s µ [X]= s (m,µ) [X], and H t m H µ [X; t]=H (m,µ) [X; t]where(m, µ) represents the partition (m, µ 1 ,µ 2 , ,µ k ). These are each given by the following formulas: the electronic journal of combinatorics 5 (1998), #R45 3 i) h m = h m [X] (1.1) ii) S m = i≥0 (−1) i h m+i [X]e ⊥ i (1.2) iii) H t m = j≥0 t j S m+j h ⊥ j (1.3) The action of each of these operators on the Schur basis is known ([15]). It is hopeful that a similar vertex operator can be found for the H m [X; q,t] symmetric functions and the action on the Schur basis can be expressed easily. Define H qt m to be ”the” operator that has the property that H qt m H µ [X; q, t]= H (m,µ) [X; q, t]. This condition alone is not sufficient to Tiểu ban: Khí tượng, thủy văn và động lực học Biển 82 HYDROLOGICAL AND SEDIMENTARY STRUCTURE OF THE WATER COLUMN IN THE BACH DANG - CAM ESTUARY LEFEBVRE Jean-Pierre 1 , ARFI Robert 2 , CHU Van Thuoc 3 , DINH Van Uu 4 , MARI Xavier 5 , PANCHE Jean-Yves 6 , TORRETON Jean-Pascal 5 , VU Duy Vinh 3 , OUILLON Sylvain 1 1 UMR 5566-LEGOS, IRD, 14 av. Edouard Belin, 31400 Toulouse, France 2 UMR 6535-LOPB, IRD, 13288 Marseille cedex 09, France 3 Institute of Marine Environment and Resources, 246 Danang, Haiphong, Vietnam 4 Hanoi University of Science, VNU, 334 Nguyen Trai, Hanoi, Vietnam 5 UMR 5119-ECOSYM, IRD, Institute of Biotechnology,18 Hoang Quoc Viet, Hanoi,Vietnam 6 US 191-IMAGO, IRD, BP A5, 98848 Nouméa cedex, New Caledonia E-mail: jean-pierre.lefebvre@ird.fr, sylvain.ouillon@legos.obs-mip.fr Abstract: The present study aimed to describe the hydrological functioning of the Northern branch of the Red River estuary (Song Hong). This research results obtained from the project "Hydrodynamic and anthropogenic influences on phytoplankton and bacterioplankton of the Bach Dang estuary"(2008-2010) funded by VAST, IRD and the French National Program EC2CO. A very contrasted functioning was observed between wet and dry seasons. During the wet season, the strong freshwater discharge dominated the flow, producing high turbulence levels. During the dry season, as the steady fluvial component weakened, the action of tidal intrusion became predominant with a significant action of tidal pumping during the dry season which is responsible of a strong silting up of the estuarine system. Tóm tắt: CẤU TRÚC TRẦM TÍCH VÀ THỦY HỌC CỦA CỘT NƯỚC Ở VÙNG CỬA SÔNG BẠCH ĐẰNG - CẤM Nghiên cứu này nhằm mục đích mô tả chức năng thủy học của nhánh sông phía Bắc thuộc vùng cửa sông Hồng. Các kết quả nghiên cứu này có được từ dự án "Ảnh hưởng nhân sinh và thủy động lực tới thực vật phù du và vi khuẩn nổi ở vùng cửa sông Bạch Đằng" (2008-2010) do Viện Khoa học và Công nghệ Việt Nam, Viện Nghiên cứu vì sự phát triển và Chương trình quốc gia EC2CO, Pháp tài trợ. Có sự tương phản rất rõ về chức năng giữa mùa mưa và mùa khô. Vào mùa mưa, dòng nước ngọt đổ ra mạnh chiếm ưu thế, gây ra các mức xáo trộn cao. Trong mùa khô, do thành phần sông ổn định bị yếu đi, ảnh hưởng của sự xâm nhập thủy triều trở nên chiếm ưu thế với tác động đáng kể của bơm thủy triều trong mùa khô là nguyên nhân gây lắng bùn mạnh của hệ thống cửa sông. Communication In order to analyze the variability in the functioning of the Bach Dang-Cam estuarine system at both the tidal and seasonal scales, two field campaigns were conducted, one in July 2008 (wet season ) and the other in March 2009 (dry season). During these two campaigns, 24-hours surveys corresponding to one spring tidal cycle were achieved at key spots of the estuarine system. During every survey, the tidal elevation was approximately 2 m. Two stations were located on the main rivers flowing into the Haiphong bay; one on the Cam River, which is connected to the Red River, and one on the Bach Dang River, at about five kilometers upstream to the mouth; the third station was located close to the mouth of the system near Dinh Vu. Water fluxes and suspended solid averaged over one tidal cycle showed high seasonal variations. Water discharge was about 4 times higher in the wet season than in Hội nghị Khoa học và Công nghệ biển toàn quốc lần thứ V - Tiểu ban Khí tượng, Thủy văn và Động lực học biển 83 the dry season at each station. The budget indicated a water loss by leakage though channels, mangroves and wetlands, which accounts for 20% and 42% of the liquid contributions of the total inputs in the wet and dry season, respectively. These budgets also indicated that during the wet season, the massive influx of sediment originated from the watershed passed through the estuary with a weak loss by deposition or leakage. During the dry season, the quantity of ... for vertebral column movements Define the ligaments of the vertebral column The anterior longitudinal ligament is attached to the vertebral bodies on the anterior side of the vertebral column The. .. between the vertebral arch and body is the vertebral foramen, which contains the spinal cord In the intact vertebral column, the vertebral foramina of all of the vertebrae align to form the vertebral. .. in the bent position 3/20 The Vertebral Column Abnormal Curvatures of the Vertebral Column (a) Scoliosis is an abnormal lateral bending of the vertebral column (b) An excessive curvature of the