Databinding with Repeater control in with C#.

Total Post:341

C#  ASP.Net 
 1092  View(s)
Rate this:
i am unable to bind data in Repeater control . how to do this please give me solution.
  1. Post:281

    Re: Databinding with Repeater control in with C#.

    A Repeater is a Data-bound control. Data-bound controls are container controls. It creates a link between the Data Source and the presentation UI to display the data. The repeater control is used to display a repeated list of items. It is server side control in

    <asp:Repeater ID="Repeater1" runat="server">


    <table style="border: 1px solid #df5015; width: 500px" cellpadding="0">


    <tr style="background-color: #df5015; color: White">

    <th style="padding-left:10px;">ID










    <tbody style="background-color: #EBEFF0; border-top: 1px dotted #df5015; width: 500px">

    <tr style="background-color: #EBEFF0">

    <td style="padding-left:10px;">

    <%#Eval("Emp_ID") %>



    <%#Eval("Emp_Name") %>



    <%#Eval("Emp_Sal") %>









    string constr = ConfigurationManager.ConnectionStrings["forumConnectionString"].ToString();

    // connection string

    SqlConnection con = new SqlConnection(constr);


    SqlCommand com = new SqlCommand("select *from Employee", con); // table name

    SqlDataAdapter da = new SqlDataAdapter(com);

    DataSet ds = new DataSet();

    da.Fill(ds); // fill dataset

    Repeater1.DataSource = ds.Tables[0]; //set DataSource Repeater

    Repeater1.DataBind(); //binding Repeater



      Modified On Apr-10-2018 05:05:59 AM