将GridDropDownColumn绑定到SQL数据源 [英] Binding GridDropDownColumn To SQL Data source
问题描述
嘿,
我无法使用sql数据源填充下拉列表--aspx是
Hey,
I am not able to Populate dropdownlist with sql data source--aspx is
<telerik:GridDropDownColumn HeaderText="Items" UniqueName="column1" DataSourceID="SqlDataSource1"
ListTextField="ProductName" ListValueField="Pid" DataField="ProductName" >
</telerik:GridDropDownColumn>
Ans数据源是-
Ans datasource is--
<asp:SqlDataSource ID="SqlDataSource1" runat="server" DataSourceMode="DataReader"
ConnectionString="<%$ ConnectionStrings:ChalkHillConnectionString3 %>"
SelectCommand="SELECT [ProductName] FROM [tblProducts] ORDER BY [Pid]"></asp:SqlDataSourc
e>
我正在尝试从tblProducts的ProductName列填充ddl.
似乎不起作用''.我收到此错误-
``System.Data.Common.DataRecordInternal''不包含名称为``Pid''的属性
请帮助....
谢谢
Amit
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
推荐答案
ConnectionStrings:ChalkHillConnectionString3 %> " span> =" 从[tblProducts]中选择[ProductName]的顺序为[Pid]" < /asp:SqlDataSourc
ConnectionStrings:ChalkHillConnectionString3 %>" SelectCommand="SELECT [ProductName] FROM [tblProducts] ORDER BY [Pid]"></asp:SqlDataSourc
e>
我正在尝试从tblProducts的ProductName列填充ddl.
似乎不起作用''.我收到此错误-
``System.Data.Common.DataRecordInternal''不包含名称为``Pid''的属性
请帮助....
谢谢
Amit
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
这应该有效.
This should work.
// ListValueField="Pid"
SelectCommand="SELECT [ProductName],[Pid] FROM [tblProducts] ORDER BY [Pid]"
这篇关于将GridDropDownColumn绑定到SQL数据源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!