Click here to Skip to main content
15,501,036 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey,

I am not able to Populate dropdownlist with sql data source--aspx is

XML
<telerik:GridDropDownColumn HeaderText="Items" UniqueName="column1" DataSourceID="SqlDataSource1"
                     ListTextField="ProductName" ListValueField="Pid" DataField="ProductName" >
                    </telerik:GridDropDownColumn>


Ans datasource is--

XML
<asp:SqlDataSource ID="SqlDataSource1" runat="server" DataSourceMode="DataReader"
            ConnectionString="<%$ ConnectionStrings:ChalkHillConnectionString3 %>"
            SelectCommand="SELECT [ProductName] FROM [tblProducts] ORDER BY [Pid]"></asp:SqlDataSourc

e>

I am trying to populate ddl from ProductName column of my tblProducts.
Does'nt seem to be workin'.I am getting this error--

'System.Data.Common.DataRecordInternal' does not contain a property with the name 'Pid'

Plz help..
Thanks
Amit
Posted

1 solution

This should work.
// ListValueField="Pid"
SelectCommand="SELECT [ProductName],[Pid] FROM [tblProducts] ORDER BY [Pid]"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900