How to use Datasource to fetch some value that has been filled in it.
- by Shantanu Gupta
I am trying to fetch a column value from a datasource when some value is selected from a dropdownlist on its change event.
<asp:DropDownList ID="ddlCityName" runat="server" DataSourceID="dsCity"
DataTextField="CityName" DataValueField="CityID" AutoPostBack="True"
OnTextChanged="CityName_OnTextChanged">
</asp:DropDownList>
<asp:SqlDataSource ID="dsCity" runat="server"
ConnectionString="<%$ ConnectionStrings:GmapConnectionString %>"
SelectCommand="SELECT * FROM [vcity]"
></asp:SqlDataSource>
Here I want to fetch any other column's value that is not binded to a ddlCityName from sqldatasource.
I have four columns in datasource i.e. name, id, address, phno.
I want to fetch an address of a person who selects some value from ddl.