rckrch
asked on
Fill text box with data from datasource in asp.net
I have a text box that I want to fill in code behind vb.net with an sqldatasource defined in asp.net client side. How to I use this data source in code behind to fill one data point in the text box. Below is my asp.net code.
Thanks in advance for the help.
<asp:SqlDataSource ID="Die_PtDscDataSource11" runat="server" ConnectionString="<%$ ConnectionStrings:...ions %>"
ProviderName="<%$ ConnectionStrings:ASTJV... finitions. ProviderNa me %>"
SelectCommand="SELECT DieNumber, PartDescription FROM METRICS WHERE Department=@Department AND PartNumber=@PartNumber">
<SelectParameters>
<asp:ControlParameter ControlID="DeptDrpDn11" Type="String" />
<asp:ControlParameter ControlID="PrtNoDrpDn11" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
Thanks in advance for the help.
<asp:SqlDataSource ID="Die_PtDscDataSource11"
ProviderName="<%$ ConnectionStrings:ASTJV...
SelectCommand="SELECT DieNumber, PartDescription FROM METRICS WHERE Department=@Department AND PartNumber=@PartNumber">
<SelectParameters>
<asp:ControlParameter ControlID="DeptDrpDn11" Type="String" />
<asp:ControlParameter ControlID="PrtNoDrpDn11" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
the Select method of SQLDataSource object need to provide with an DataSourceSelectArguments argument, DataSourceSelectArguments. Empty is used to tell that the argument's value is Empty.
DataSourceSelectArguments. Empty Property
https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.datasourceselectarguments.empty?view=netframework-4.7.2
DataSourceSelectArguments.
https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.datasourceselectarguments.empty?view=netframework-4.7.2
ASKER
Thanks
ASKER
That did work. Before I close this out would you explain to me how this works. The "DataSrouceSelectArguments
Thanks,
Rick