ASP.NET在数据列表中重复数据 [英] ASP.NET Repeat data in datalist
问题描述
我正在使用更新面板和数据列表来重复数据.我想正确查看数据Emp_id, Emp_Name
的显示,但是我想使用由datalist生成的Emp_Id
来查看另一个表中的某些数据.但是我不能那样做.如何检索由数据列表生成的Emp_Id
以在select sql命令中使用.
例如:-Select * from Table where Emp_Id=?
参数用途是什么.
Emp_Id
仅在<%#Eval("Emp_Id")%>
中生成,但是我不能在命令中使用它,因为
此命令生成Emp_Id
这是原始命令:
I am using update panel and datalist to repeat data. I want to view data Emp_id, Emp_Name
its display correctly but i want to use the Emp_Id
generate by the datalist to view some data from another table. But i can''t do that. How can i retrieve the Emp_Id
generated by the datalist to use in select sql command.
Ex:-Select * from Table where Emp_Id=?
what is the parameter use.
Emp_Id
only generated in <%#Eval("Emp_Id")%>
but i can''t use it in the command because
this command is generated the Emp_Id
Here is the original command:
SELECT * FROM empdetails,department where empdetails.emp_allow=1 and empdetails.Emp_ID="?" and department.emp_status=1
在这里,从empdetails中选择*生成我要使用的EmP_id并生成Emp_Id.
请任何人都可以帮助我.....在此先感谢
Here select * from empdetails generate EmP_id and generate Emp_Id i want to use.
Please any one can help me.....Thanks in advance
推荐答案
尝试此链接
在DataList中插入更新删除 [ ^ ]
try this link
Insert Update Delete in DataList[^]
//Put one Link button in your DataList
<asp:LinkButton ID="lnk_Update" CssClass="button" CommandName="GetData" CommandArgument="<%#Eval("EmpId")%>" runat="server" >
//Now in row command Event fetch this value in code behind and get your Data From the DataBase
希望此 [ ^ ]也可能会为您提供帮助.
Hope this[^] also might help you.
这篇关于ASP.NET在数据列表中重复数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!