« Home « Chủ đề kĩ thuật lập trình

Chủ đề : kĩ thuật lập trình


Có 200+ tài liệu thuộc chủ đề "kĩ thuật lập trình"

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

Using the Data Form Wizard to Create a Windows Form phần 1

tailieu.vn

Using the Data Form Wizard to Create a Windows Form. In this section, you'll use the VS .NET Data Form Wizard to create a Windows. application that accesses both the Customers and Orders tables. The Orders table contains rows that represent orders placed by the customers.. The rows in the Orders table are related to the rows in the Customers...

Using the Data Form Wizard to Create a Windows Form phần 2

tailieu.vn

Figure 6.23: Creating a relationship between two tables. Note Remember: You're unselecting these columns, so you uncheck the columns for the Orders table.. Figure 6.24 shows the completed dialog box with the selected columns to display from each table.. Figure 6.24: Selecting the columns to display from each table 8. Select the display style for the rows (also known as...

Using the Default Sort Algorithm

tailieu.vn

If you want to sort the DataRowView objects in your DataView based on the primary key of your DataTable, you can use a shortcut. Instead of setting the Sort property of your DataView, you set the PrimaryKey property of your DataTable and then set the ApplyDefaultSort property of your DataView to true.. The Sort property of your DataView is then...

Using the Get* Methods to Read Column Values

tailieu.vn

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

Using the SQL Server Documentation

tailieu.vn

Using the SQL Server Documentation. SQL Server also comes with extensive electronic documentation. documentation, you select Start ➣ Programs ➣ Microsoft SQL Server ➣ Books Online.. Figure 1.9 shows the SQL Server documentation home page.. Figure 1.9: SQL Server documentation home page. You can browse the online books using the Contents tab, and you can search for specific information using...

Using Transactions with a DataSet (SQL)

tailieu.vn

Using Transactions with a DataSet (SQL). In Chapter 3, "Introduction to Structured Query Language,". you saw how you can group SQL statements together into transactions. The transaction is then committed or rolled back as one unit. You would then commit both of these changes as one unit, or if there's a problem, rollback both changes.. In Chapter 8, "Executing Database...

Using Windows Controls

tailieu.vn

Table 6.2 lists the commonly used Windows form controls that you can pick from the Windows Forms section of the Toolbox. You can place any of these controls on your Windows form.. Table 6.2: COMMONLY USED WINDOWS FORM CONTROLS CONTROL DESCRIPTION. You set the text that you want to display using the Text property.. LinkLabel Similar to a label, except...