我正在使用Reapeter,但它不起作用? [英] I am using Reapeter, but it is not working ?

查看:94
本文介绍了我正在使用Reapeter,但它不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的Codeproject,

http://timestech.somee.com/jobdetail.aspx [ ^ ]

i am using repeater而且我在aspx页面上对此进行了谴责

 div class =mancontaner> 

< h1 > ; 搜索作业< / h1 > ;
< br / >

< asp:Repeater ID = Repeater1 runat = server >
< headerTemplate >
名称:<% Eval ( fname%>
< / headerTemplate >
< itemTemplate >
<%#DataBinder.Eval(Container.DataItem, lname%>
< / itemTemplate >
< / asp:Repeater >

< / div >





我正在使用与Vb.net的连接



如下所示

 公共 功能 connecton()作为 SqlConnection 
con = SqlConnection( server = jobportal1.mssql.somee.com; database = jobportal1; uid = irfanansari; pwd =密码
'

返回 con
结束 功能





 公共 功能 searchjobs()
com =新的SqlCommand( select * from tbllogin,Me.con)
adpt = New SqlDataAdapter
adpt.SelectCommand = com
表格 =新的DataTable
adpt.Fill( table

结束 功能





当我尝试运行时没有显示结果,请帮助我

解决方案





您只是从表中获取值但不绑定转发器。



问候,


 adpt.Fill(table)
Repeater1.DataSource = table
Repeater1.DataBind()

End Fu nction


Dear Codeproject,
http://timestech.somee.com/jobdetail.aspx[^]
i am using repeater and i am codking likne this on aspx page

div class="mancontaner">

<h1>Search Job</h1>
            <br />

            <asp:Repeater ID="Repeater1" runat="server">
            <headerTemplate>
            Name:<% Eval("fname")%>
            </headerTemplate>
            <itemTemplate>
            <%#DataBinder.Eval(Container.DataItem, "lname")%>
            </itemTemplate>
            </asp:Repeater>

</div>



and I Am Using Connection with Vb.net

as bellow

Public Function connecton() As SqlConnection
        con = New SqlConnection("server=jobportal1.mssql.somee.com;database=jobportal1;uid=irfanansari;pwd=password")
        ' 

        Return con
    End Function



Public Function searchjobs()
       com = New SqlCommand("select * from  tbllogin ", Me.con)
       adpt = New SqlDataAdapter
       adpt.SelectCommand = com
       table = New DataTable
       adpt.Fill(table)

   End Function



when I try to run there is no result shown,pls help me out

解决方案

Hi,

You are just fetching the values from the table but not binding the repeater.

Regards,


adpt.Fill(table)
Repeater1.DataSource=table
Repeater1.DataBind()

End Function


这篇关于我正在使用Reapeter,但它不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆