创建 SQL 数据源
我有一个表 (EmployeeID
,EmployeeName
,ManagerID
) 如何创建 SQLDataSource
来包含 ManagerName
来自 EmployeeName
给定的 EmployeeID = ManagerID
?在我的 GridView 中,拖动 DropDownList
后,我应该执行什么绑定来显示 ManagerName
?是否可以在不编写自定义 SELECT
、INSERT
、DELETE
或 UPDATE
的情况下使用它?如果不是,我需要执行哪些步骤来编写整个内容,即自定义网格和源?
I have a table (EmployeeID
,EmployeeName
,ManagerID
) How can I create a SQLDataSource
to include the ManagerName
from the EmployeeName
given EmployeeID = ManagerID
? In my GridView
after dragging a DropDownList
what bindings should I do to display the ManagerName
? Is it possible to use it without writing custom SELECT
, INSERT
, DELETE
or UPDATE
? If not what are the steps I need to do to write the whole thing i.e. custom grid and source?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SQL 数据源控件仅允许您轻松地将 ASP.NET 数据绑定控件连接到数据源。您仍然需要编写正确的 SQL 来执行相关连接并获取所需的数据。例如,您必须编写一个 sql 命令,如下所示:
SQL datasource controls just allow you to easily wire up asp.net databound controls to datasources. You still have to write the correct SQL to do the relevent joins and get the data you require. e.g. you would have to write a sql commaind something like: