Executing Multiple SQL Statements
... illustrates how to execute multiple SQL statements. Listing 9.5: EXECUTEMULTIPLESQL.CS /* ExecuteMultipleSQL.cs illustrates how to execute multiple SQL statements using a SqlCommand object */ using ... mySqlDataReader[0] = 10252 mySqlDataReader[1] = SUPRD mySqlDataReader[0] = 10253 mySqlDataReader[1] = HANAR Executing Multiple SELECT, INSERT, UPDATE, and DELETE Statements You...
Ngày tải lên: 28/10/2013, 15:15
... Executing a SQL Server Stored Procedure By Using ActiveX Data Objects If you are doing an ADO development ... the T -SQL for CustOrderHist in Listing A.7. This stored procedure returns product names and the total quantity purchased of those products for a given customer. Listing A.7 Northwind SQL Server ... purchased of those products for a given customer. Listing A.7 Northwind S...
Ngày tải lên: 14/12/2013, 20:16
... String sqlText = "SELECT * FROM Customers"; // Retrieve table with all customers. SqlDataAdapter da = new SqlDataAdapter(sqlText, ConfigurationSettings.AppSettings[" ;Sql_ ConnectString"]); ... [ Team LiB ] Recipe 2.21 Using Parameterized SQL Statements Problem You want to create and execute a SQL statement having parameters that are set dynamically. So...
Ngày tải lên: 21/01/2014, 11:20
Executing SELECT Statements and TableDirect Commands phần 1
... table: SqlConnection mySqlConnection = new SqlConnection( "server=localhost;database=Northwind;uid=sa;pwd=sa" ); SqlCommand mySqlCommand = mySqlConnection.CreateCommand(); mySqlCommand.CommandText ... database SqlConnection mySqlConnection = new SqlConnection( "server=localhost;database=Northwind;uid=sa;pwd=sa" ); // create a SqlCommand object SqlCommand mySqlCommand = myS...
Ngày tải lên: 28/10/2013, 16:15
Executing SELECT Statements and TableDirect Commands phần 2
... "server=localhost;database=Northwind;uid=sa;pwd=sa" ); SqlCommand mySqlCommand = mySqlConnection.CreateCommand(); // set the CommandText property of the SqlCommand object to // a SELECT statement that retrieves XML mySqlCommand.CommandText ... "server=localhost;database=Northwind;uid=sa;pwd=sa" ); SqlCommand mySqlCommand = mySqlConnection.CreateCommand();...
Ngày tải lên: 07/11/2013, 10:15
Executing SQL Server Stored Procedures phần 1
... Executing SQL Server Stored Procedures In Chapter 4 , you saw how to create and execute SQL Server stored procedures using T- SQL. You execute a stored procedure using the T -SQL EXECUTE ... box"; mySqlCommand.Parameters.Add( "@MyUnitPrice", SqlDbType.Money).Value = 5.99; mySqlCommand.Parameters.Add( "@MyUnitsInStock", SqlDbType.SmallInt).Value = 10; m...
Ngày tải lên: 07/11/2013, 10:15
Executing SQL Server Stored Procedures phần 2
... "@MyUnitPrice", SqlDbType.Money).Value = 5.99; mySqlCommand.Parameters.Add( "@MyUnitsInStock", SqlDbType.SmallInt).Value = 10; mySqlCommand.Parameters.Add( "@MyUnitsOnOrder", SqlDbType.SmallInt).Value ... Command object mySqlCommand.Parameters.Add("@MyProductID", SqlDbType.Int); mySqlCommand.Parameters["@MyProductID"].Direction =...
Ngày tải lên: 07/11/2013, 10:15
Tài liệu Executing SQL Server User-Defined Scalar Functions doc
... [ Team LiB ] Recipe 2.13 Executing SQL Server User-Defined Scalar Functions Problem Your SQL Server 2000 database includes a user-defined function that ... uses a single SQL Server function: ExtendedPrice Calculates and returns the extended price for an order line item based on the unit price, quantity, and discount. Example 2-16. SQL Server function: ... BEGIN RETUR...
Ngày tải lên: 21/01/2014, 11:20
Tài liệu Using a Single Stored Procedure to Update Multiple Changes to a SQL Server Database pdf
... Stored Procedure to Update Multiple Changes to a SQL Server Database Problem You need to update a SQL Server 2000 database with changes to multiple rows in a DataSet by executing a single stored ... the update stored procedure. SqlConnection conn = new SqlConnection( ConfigurationSettings.AppSettings[" ;Sql_ ConnectString"]); SqlCommand cmd = new SqlCommand( );...
Ngày tải lên: 21/01/2014, 11:20
Tài liệu Executing Batch Updates with ADO and SQL Server doc
... Executing Batch Updates with ADO and SQL Server The biggest difference between this section and the previous one ... we can assign values as we declare variables Dim strSQL As String = "Update Orders Set ShippedDate = ShippedDate+1" Dim strDispSQL As String = _ "Select OrderID, ShippedDate ... rstOld.Open(strDispSQL, cnn) txtResults.Text = "Old Values: "...
Ngày tải lên: 21/01/2014, 12:20