asp.net.ph

SqlDataSourceCommandType Enumeration

System.Web.UI.WebControls Namespace


Describes the type of SQL command used by the SqlDataSource and AccessDataSource controls when performing a database operation.

Members


Member Description
StoredProcedure The text contained in a corresponding text property is the name of a stored procedure.
Text The text contained in a corresponding text property is a SQL query or command.

Remarks

The SqlDataSourceCommandType enumeration is used by the SqlDataSource and AccessDataSource controls to describe the type of SQL command contained in the SelectCommand, InsertCommand, UpdateCommand, and DeleteCommand properties. The Text value indicates that the text is a SQL query or command string while the StoredProcedure value indicates that the text is the name of a stored procedure.

Example

The following example demonstrates how to set the SelectCommand text to the name of a stored procedure and the SelectCommandType property to the StoredProcedure value to retrieve data from a Microsoft SQL Server database and display it in a DropDownList.

<asp:DropDownList runat = "server"
   id = "DropDownList1"
   DataTextField = "LastName"
   DataSourceID = "SqlDataSource1" />

<asp:SqlDataSource runat = "server"
   id = "SqlDataSource1"
   ConnectionString = "<%$ ConnectionStrings:MyNorthwind%>"
   SelectCommandType = "StoredProcedure" 
   SelectCommand = "sp_lastnames">
</asp:SqlDataSource>
Skip Navigation Links



Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph