Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
myPrimaryKey = OrderID myPrimaryKey = ProductID myDataColumn.ColumnName = OrderID myDataColumn.DataType = System.Int32 myDataColumn.AllowDBNull = False myDataColumn.AutoIncrement = False | myPrimaryKey OrderID myDataColumn.ColumnName OrderID myDataColumn.DataType System.Int32 myDataColumn.AllowDBNull False myDataColumn.AutoIncrement False myDataColumn.AutoIncrementSeed 0 myDataColumn.AutoIncrementStep 1 myDataColumn.MaxLength -1 myDataColumn.ReadOnly False myDataColumn.Unique True Reading from the Order Details DataTable myPrimaryKey OrderID myPrimaryKey ProductID myDataColumn.ColumnName OrderID myDataColumn.DataType System.Int32 myDataColumn.AllowDBNull False myDataColumn.AutoIncrement False myDataColumn.AutoIncrementSeed 0 myDataColumn.AutoIncrementStep 1 myDataColumn.MaxLength -1 myDataColumn.ReadOnly False myDataColumn.Unique False myDataColumn.ColumnName ProductID myDataColumn.DataType System.Int32 myDataColumn.AllowDBNull False myDataColumn.AutoIncrement False myDataColumn.AutoIncrementSeed 0 myDataColumn.AutoIncrementStep 1 myDataColumn.MaxLength -1 myDataColumn.ReadOnly False myDataColumn.Unique False myDataColumn.ColumnName UnitPrice myDataColumn.DataType System.Decimal myDataColumn.AllowDBNull True myDataColumn.AutoIncrement False myDataColumn.AutoIncrementSeed 0 myDataColumn.AutoIncrementStep 1 myDataColumn.MaxLength -1 myDataColumn.ReadOnly False myDataColumn.Unique False Adding Restrictions by Calling the DataAdapter Object s FillSchema Method Instead of adding restrictions yourself you can add them by calling the FillSchema method of your DataAdapter. The FillSchema method does the following Copies the schema information from the database. Creates DataTable objects in your DataSet if they don t already exist. Adds the constraints to the DataTable objects. Sets the properties of the DataColumn objects appropriately. The properties of the DataColumn objects set by FillSchema include the following The DataColumn name-which is stored in the ColumnName property. The DataColumn .NET data type-which is stored in the DataType property. The maximum length of a variable length data type-which is stored in the MaxLength property. Whether the .