Thực hiện tham số lưu trữ 4,3 Thủ tục trong Để tận dụng thủ tục lưu trữ cho toàn bộ sức mạnh của mình, bạn cần để có thể vượt qua các thông số để các tiêu chí cụ thể có thể được sử dụng. | Execute Parameterized Stored Procedures in To take advantage of stored procedures to their full power you need to be able to pass parameters so that specific criteria can be used. This How-To describes how to create parameters off the OleDbCommand objects to pass parameters to SQL Server. You need to execute a parameterized stored procedure in your application. How do you do this using Visual Basic .NET and Technique In ADO you have a Command object to execute stored procedures among other tasks. In you also have a Command object that performs basically the same task. In fact many of the properties and methods that you use are the same. You can see a list of those in Table . Table . Objects That Are Used for This Technique with Properties and Methods Object Property Description Method Connection ConnectionString Contains the connection string that is used. Connection Open Opens the connection that the Command object uses. Command cmdText Specifies the SQL statement to use. Can be SQL statement or names of objects such as tables or stored procedures. Command Connection Uses the Connection object. Command CommandType Specifies the type of command you want to execute. Can be one of the following command types StoredProcedure DirectTable or Text. Command Parameters Parameters to pass to the stored procedure. Command ExecuteReader Creates a DataReader object with the data that the command object specifies. DataReader Read Reads the next record in the DataReader and also tests the end of the data returned. DataReader GetString Returns the current record getting the column specified and returns it as string. DataReader GetInt32 Returns the current record getting the column specified and returns it as 32-bit integer. You will use these objects and their properties and methods for the following steps. Steps Open and run the 4 solution. From the main form click on the command button with the caption How-To . When the form .