« Home « Chủ đề C Shark

Chủ đề : C Shark


Có 100+ tài liệu thuộc chủ đề "C Shark"

The SqlDataReader Class

tailieu.vn

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...

The UniqueConstraint Class

tailieu.vn

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...

The Web Form Controls

tailieu.vn

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...

Understanding SQL Server Locks

tailieu.vn

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...

Understanding the SqlConnection Class

tailieu.vn

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...

Using a DataGrid Control to Access a Database

tailieu.vn

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...

Using a DataReader Object in Visual Studio .NET

tailieu.vn

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...

Using a SqlConnection Object to Connect to a SQL Server Database phần 1

tailieu.vn

Using a SqlConnection Object to Connect to a SQL Server Database. You create a SqlConnection object using the SqlConnection() constructor. constructor is overloaded, meaning that there are multiple versions of the constructor that you can call. where connectionString contains the details for the database connection. You'll learn the details of the connectionString in this section.. Assuming you've imported the System.Data.SqlClient...

Using a SqlConnection Object to Connect to a SQL Server Database phần 2

tailieu.vn

mySqlConnection.State = Open count = 2. mySqlConnection.State = Open count = 3. mySqlConnection.State = Open count = 4. mySqlConnection.State = Open count = 5. mySqlConnection.State = Open count = 6. mySqlConnection.State = Open count = 7. mySqlConnection.State = Open count = 8. mySqlConnection.State = Open count = 9. mySqlConnection.State = Open count = 10. mySqlConnection.State = Open. As you can...

Using Cursors

tailieu.vn

To do this, you can use a cursor to process rows retrieved from the database one row at a time. Declare variables to store the column values from the SELECT statement.. Open your cursor.. Fetch the rows from your cursor.. Close your cursor.. Step 1: Declare Variables to Store the Column Values from the SELECT Statement These variables must be...

Using Functions phần 1

tailieu.vn

SQL Server provides a number of functions you can use to get values from the database.. For example, you can use the COUNT() function to get the number of rows in a table.. Table 4.2: FUNCTIONS FUNCTION. System Return information on SQL Server.. Configuration Return information on the configuration of the server.. You'll learn about the first five functions in...

Using Functions phần 2

tailieu.vn

You use the POWER() function to get the value of a number raised to a specified power.. The following example returns 8:. You use the ROUND() function to get the value of a number rounded or truncated to a specified length. The following example returns 1.23500, which is 1.23456 rounded to three decimal places:. This example returns 1.23400, which is...

Using SQL phần 1

tailieu.vn

With SQL, you tell the database what data you want to access, and the database software figures out exactly how to get that data.. DML statements allow you to retrieve, add, modify, and delete rows stored in the database. Before you learn the basics of DML statements, you need to know how you can enter and run SQL statements. You...

Using SQL phần 2

tailieu.vn

Figure 3.6: Products where ProductName is like 'Cha%'. The next SELECT statement uses the LIKE operator to retrieve products where the ProductName column is like '[ABC]%':. WHERE ProductName LIKE '[ABC]%';. Figure 3.7 shows the results of this SELECT statement. Figure 3.7: Products where ProductName is like '[ABC]%'. The next SELECT statement uses the LIKE operator to retrieve products where the...

Using SQL phần 3

tailieu.vn

Figure 3.16: Using the DISTINCT keyword to retrieve distinct Country column values As you can see, the SELECT statement only displays Country column values that are unique: duplicate values are eliminated. Combining Retrieved Rows From SELECT Statements. You use the UNION operator to combine retrieved rows from SELECT statements into one set of rows. For example, the following SELECT statement...

Using SQL phần 4

tailieu.vn

When removing a row, you specify the name of the table and the rows to delete using a WHERE clause.. Warning If you omit the WHERE clause in a DELETE statement, all rows from the table will be deleted. Make sure you provide a WHERE clause if you don't want to remove all the rows from the table. Typically, you'll...

Using SQL Server

tailieu.vn

Using SQL Server. In this section, you'll explore some of the tools you use to manage SQL Server.. Specifically, you'll learn how to start and stop SQL Server using the Service Manager and use the Enterprise Manager to administer SQL Server.. Starting and Stopping SQL Server. To open the Service Manager, you select Start ➣ Programs ➣ Microsoft SQL Server...

Using Stored Procedures to Add, Modify, and Remove Rows from the Database phần 1

tailieu.vn

Using Stored Procedures to Add, Modify, and Remove Rows from the Database You can get a DataAdapter object to call stored procedures to add, modify, and remove rows from the database. The ability to call stored procedures using a DataAdapter is a very powerful addition to ADO.NET. Tip Using stored procedures instead of INSERT, UPDATE, and DELETE statements can also...

Using Stored Procedures to Add, Modify, and Remove Rows from the Database phần 2

tailieu.vn

Setting the InsertCommand Property of a DataAdapter. The following example creates a SqlCommand object named myInsertCommand that contains a call to the AddProduct4() stored procedure:. myInsertCommand.Parameters.Add(. myInsertCommand.Parameters["@MyProductID"].Direction = ParameterDirection.Output;. "@MyProductName", SqlDbType.NVarChar, 40, "ProductName");. "@MyUnitPrice", SqlDbType.Money, 0, "UnitPrice");. parameters is set to 0 in the third parameter to the Add() method. Next, the following example sets the InsertCommand property of mySqlDataAdapter...

Using the .NET

tailieu.vn

Using the .NET Documentation. Both the .NET SDK and VS .NET come with extensive documentation, including the full reference to all the classes in .NET. In the following sections, you'll see how to access and search the .NET documentation, and view some of the contents of the documentation. Depending on whether you're using the .NET SDK or VS .NET, you...