Có 180+ tài liệu thuộc chủ đề "kĩ thuật lập trình"
tailieu.vn Xem trực tuyến Tải xuống
Supplying Parameters to Commands. In the examples you've seen up to this point, the values for each column have been hard- coded in the SQL statements. For example, in Listing 8.9, shown earlier, the INSERT statement that added the row to the Customers table was:. As you can see, the values for the CustomerID and CompanyName columns are hard- coded...
tailieu.vn Xem trực tuyến Tải xuống
The DataColumn Class. You use an object of the DataColumn class to represent a column. Table 11.6 shows some of the DataColumn properties.. AllowDBNull bool Gets or sets a bool value that indicates whether null values are allowed in this DataColumn object. The default is true.. AutoIncrement bool Gets or sets a bool value that indicates whether the DataColumn object...
tailieu.vn Xem trực tuyến Tải xuống
The DataRow Class. You use an object of the DataRow class to represent a row. Table 11.4 shows some of the DataRow properties.. HasErrors bool Returns a bool value that indicates whether any of the DataColumn objects in the DataRow have errors.. ItemArray object[] Gets or sets all the DataColumn objects in the DataRow.. RowState DataRowState Gets the current state...
tailieu.vn Xem trực tuyến Tải xuống
The DataRowView Class. Rows in a DataView object are stored as objects of the DataRowView class. Table 13.4 shows some of the DataRowView properties, and Table 13.5 shows some of the DataRowView methods.. DataView DataView Gets the DataView that the DataRowView belongs to.. IsEdit bool Gets a bool that indicates whether the DataRowView (and therefore the underlying DataRow) is in...
tailieu.vn Xem trực tuyến Tải xuống
The DataSet Class. You use an object of the DataSet class to represent a local copy of the information stored in the database. Figure 10.1 shows the DataSet and its relationship to some of the objects you can store within it. Figure 10.1: Some of the DataSet objects. Table 10.4 shows some of the DataSet properties.. Table 10.4: DataSet PROPERTIES....
tailieu.vn Xem trực tuyến Tải xuống
You can read the Products DataTable from myDataSet using the following example:. DataTable myDataTable = myDataSet.Tables["Products"];. You can also read the Products DataTable using an int value:. DataTable myDataTable = myDataSet.Tables[0];. You can display the column values for each row in myDataTable using the following foreach loop that iterates over the DataRow objects stored in myDataTable. notice the use of...
tailieu.vn Xem trực tuyến Tải xuống
Reading from the Products DataTable ProductID = 1. Reading from the Customers DataTable CustomerID = ALFKI. First, the following code populates a DataSet with a DataTable containing two rows from the Products table:. mySqlCommand.CommandText. mySqlDataAdapter.SelectCommand = mySqlCommand;. int numberOfRows = mySqlDataAdapter.Fill(myDataSet, "Products");. Next, the CommandText property for the SelectCommand of mySqlDataAdapter is changed to a SELECT statement that retrieves rows...
tailieu.vn Xem trực tuyến Tải xuống
The DataTable Class. You use an object of the DataTable class to represent a table. Table 11.1 shows some of the DataTable properties.. DataColumn objects that represent the columns in the DataTable object.. (UniqueConstraint) or foreign key constraints (ForeignKeyConstraint) in the DataTable object.. DataSet DataSet Gets the DataSet to which the DataTable belongs.. HasErrors bool Returns a bool value that...
tailieu.vn Xem trực tuyến Tải xuống
The DataViewManager Class. A DataViewManager allows you to centrally manage multiple DataView objects in a DataSet. A DataViewManager also allows you to create DataView objects on the fly at runtime. Table 13.6 shows some of the DataViewManager properties.. Table 13.6: DataViewManager PROPERTIES. DataSet DataSet Gets or sets the DataSet used by your DataViewManager.. DataViewSettings DataViewSettingCollection Gets the DataViewSettingCollection for each...
tailieu.vn Xem trực tuyến Tải xuống
The members of the. Cascade, which indicates that the changes to the DataRow objects in the parent DataTable are also made in the child DataTable.. DeleteRule Rule Gets or sets the Rule that indicates the action that is to take place when a DataRow in the parent DataTable is deleted.. Cascade, which indicates that the delete or update to the...
tailieu.vn Xem trực tuyến Tải xuống
The Managed Provider and Generic Data Set Classes. To provide both connected and disconnected database access, ADO.NET defines two sets of classes: managed provider and generic data.. You use objects of the managed provider classes to directly connect to a database and to synchronize your locally stored data with the database. You can use the managed. provider classes to read...
tailieu.vn Xem trực tuyến Tải xuống
The SqlCommand Class. You use an object of the SqlCommand class to execute a command against a SQL Server database, an object of the OleDbCommand class to execute a command against any database that supports OLE DB, such as Oracle or Access, and an object of the. OdbcCommand class to execute a command against any database that supports ODBC.. Table...
tailieu.vn Xem trực tuyến Tải xuống
The SqlDataAdapter Class. You use an object of the SqlDataAdapter class to synchronize data stored in a DataSet object with a SQL Server database. You use an object of the OleDbDataAdapter class to synchronize data with a database that supports OLE DB, such as Oracle or Access. You use an object of the OdbcDataAdapter class to synchronize data with a...
tailieu.vn Xem trực tuyến Tải xuống
You use an object of the SqlDataReader class to read rows retrieved from a SQL Server database, an object of the OleDbDataReader class to read rows from any database that supports OLE DB, such as Oracle or Access, and an object of the OdbcDataReader class to read rows from any data-base that supports ODBC. Table 9.1 shows some of the...
tailieu.vn Xem trực tuyến Tải xuống
The UniqueConstraint Class. You use an object of the UniqueConstraint class to ensure that a DataColumn value, or combination of DataColumn values, is unique for each DataRow in a DataTable. The UniqueConstraint class is derived from the System.Data.Constraint class. Table 12.1 shows the UniqueConstraint properties.. Table 12.1: UniqueConstraint PROPERTIES PROPERTY TYPE DESCRIPTION. Columns DataColumn[] Gets the array of DataColumn objects...
tailieu.vn Xem trực tuyến Tải xuống
You set the text that you want to display using the Text property.. TextBox A box containing text that the user of your form may edit at runtime. The Text property contains the TextBox text.. The Text property determines the text shown on the button.. You set the link using the Text property.. You set the image using the ImageUrl...
tailieu.vn Xem trực tuyến Tải xuống
Table 14.5: SQL Server Lock Types LOCK. SQL Server Locking Modes. You'll see these locking modes in the next section.. Table 14.6: SQL Server Locking Modes LOCKING. Indicates that the transaction intends to place a shared lock on some of the resources with a finer level of granularity within that resource. For example, placing an IS lock on a table...
tailieu.vn Xem trực tuyến Tải xuống
Understanding the SqlConnection Class. You use an object of the SqlConnection class to connect to a SQL Server database, and this object handles the communication between the database and your C# program.. Note Although the SqlConnection class is specific to SQL Server, many of the properties, methods, and events in this class are the same as those for the OleDbConnection...
tailieu.vn Xem trực tuyến Tải xuống
In this section, you'll learn how to use a DataGrid control to access the rows in a database table. In the New Project dialog box, select Windows Application, and enter DataGridWindowsApplication in the Name field.. Add a DataGrid control to the form by selecting View ➣ Toolbox, selecting a DataGrid, and dragging it to your form. Figure 6.9 shows a...
tailieu.vn Xem trực tuyến Tải xuống
You'll see how to execute this SELECT statement, read the result set using the SqlDataReader object, and display the result set in a ListView control. To open the completed project, select File ➣ Open ➣ Project, browse to the VS .NET projects\DataReader directory, and open the. If you are modifying your existing Windows application, drag a ListView control to your...