在gridview记录中不显示 [英] in gridview records not displaying
问题描述
Facid Facname
1 ram
2 suresh
3 vignesh
4 yadhav
5 kumar
Bthfac表格如下
Bfid Facid
1 1,2
2 2,3
3 3,4
4 4,5
代码如下在显示按钮
Facid Facname
1 ram
2 suresh
3 vignesh
4 yadhav
5 kumar
Bthfac table as follows
Bfid Facid
1 1,2
2 2,3
3 3,4
4 4,5
code as follows in show button
sql = "select distinct r.rate,f.bfid as BFid,CASE FROM bthfac AS f,batch b,facfeedback r where month(b.examdate)= '" + Ddlmonth.Text.ToString() + "' and year(b.examdate)= '" + DropDownList2.Text.ToString() + "' and r.bfid=f.bfid and b.bthid=f.bthid and f.facid = ' + DropDownList4.Text.ToString().Trim() + '";
dr = scon.ReadSql(sql);
GridView.DataSource = dr;
GridView.DataBind();
GridView.Visible = true;
在运行模式下如下;
月份ddlmonth(下拉列表)
年度下拉列表2
facid dropdownlist4
例如在运行模式下从下拉列表中选择月,年和facid
第10个月
2011年
facid 1,2
>
当我选择三个下拉列表值并单击显示按钮。
未显示gridview记录。
请帮帮我。
上面的代码有什么问题。
i认为dropdownlist4 facid值为1,2。所以我们必须拆分facid。
请帮帮我。
问候,
Narasiman P.
in run mode as follows;
Month ddlmonth (dropdownlist)
Year dropdownlist2
facid dropdownlist4
for example in run mode select the month,year and facid from the dropdownlist
Month 10
Year 2011
facid 1,2
when i select the three dropdownlist values and click the Show button.
in gridview records not displaying.
please help me.
what is the problem in my above code.
i think in dropdownlist4 facid values is 1,2. so we have to split the facid .
please help me.
Regards,
Narasiman P.
推荐答案
删除ddl.Text.Tostring()并放置Ddl.SelectedText并调试代码
Remove the ddl.Text.Tostring() and Place Ddl.SelectedText and Debug the code
您必须进入Gridview控件并将其配置为绑定到下拉框。
You have to go into the Gridview Control and configure it to be bound to the dropdown boxes.
这篇关于在gridview记录中不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!