getdatasources — enumerate available data sources


string[] getdatasources ( );  


Returns an array containing the names of all defined data sources.

Example 34. getdatasources Example

This example code populates a select control with the names of all the defined data sources.

<select name="datasource">
string[] sources = getdatasources();
for(int i = 0; i < sources.length(); i++)
    print("<option value=\"" + htmlencode(sources[i]) + "\">"
      + htmlencode(sources[i]) + "</option>\n");

See Also

Data sources and database access in RSP is explained in the section called “Accessing Databases”