|
Server API Reference |
Top Previous Next |
|
The simplest instance of DbNetCombo can be created by specifying just the ConnectionString and Sql properties Adds an empty option to the list of items. The ConnectionString property provides the information necessary to connect to the database. The connection string can either be an actual connection string or an alias which is resolved by finding a matching entry in the <connectionStrings> section of the web.config file. For details of specifying connection strings see the database connectivity section. The ComboClientEvents collection allows you to specify handlers for any of the client-side events that are available. <DNL:DbNetCombo id="DbNetCombo1" runat="server" AddEmptyOption = "true" EmptyOptionText = "Please select a customer ..." ConnectionString = "SamplesDatabase" Sql = "select CustomerID,CompanyName,ContactName,ContactTitle,Address,City,Region,PostalCode,Country,Phone,Fax from customers order by companyname" > <ComboClientEvents> <DNL:ComboClientEvent EventName="onChange" Handler="displayCustomer"/> </ComboClientEvents> </DNL:DbNetCombo> Specifies the text for the empty option if enabled by the AddEmptyOption property. Collection of LinkedControl objects that have the property LinkedControlID which is the ID of the child control Specifies the SQL statement that will be run against the database and used to populate the list of items in the combo. <DNL:DbNetCombo id="DbNetCombo1" runat="server" ConnectionString = "SamplesDatabase" Sql = "select customerid, companyname from customers order by companyname" > </DNL:DbNetCombo>
|