将GridDropDownColumn绑定到SQL数据源

编程入门 行业动态 更新时间:2024-10-28 11:20:17
本文介绍了将GridDropDownColumn绑定到SQL数据源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

嘿, 我无法使用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> SelectCommand =" 从[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数据源

本文发布于:2023-11-12 23:23:23,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1582793.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据源   绑定   GridDropDownColumn   SQL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!