asp.net.ph

SqlDataSource.SelectCommandType Property

System.Web.UI.WebControls Namespace   SqlDataSource Class


.NET Framework version 2.0

Sets or retrieves a value indicating whether the text in the SelectCommand property is an SQL query or the name of a stored procedure.

Syntax


Inline <asp:SqlDataSource selectcommandtype = enumValue ... >
Script SqlDataSource.SelectCommandType [ = enumValue ]

Property Value


enumValue One of the SqlDataSourceCommandType values.

The property is read/write with a default value of Text.

Remarks

The SelectCommandType property delegates to the SelectCommandType property of the SqlDataSourceView object that is associated with the SqlDataSource control.

Example

The following example demonstrates how to set the SelectCommand value to the name of a Microsoft Access query and the SelectCommandType property to the StoredProcedure value, in order to retrieve data from a Microsoft Access database and display it in a GridView control.

<asp:accessdatasource id="zipcodes" runat="server"
   datafile="~/app_data/usa.mdb"
   selectcommand="[Zipcodes By State and County]"
   selectcommandtype="StoredProcedure">

   <selectparameters>
      <asp:controlparameter controlid="lstStates" 
         propertyname="SelectedValue" />
      <asp:controlparameter controlid="lstCounties" 
         propertyname="SelectedValue" />
   </selectparameters>

</asp:accessdatasource>

 Show me 

See Also

SelectCommand 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