Home > DeveloperSection > Forums > Databinding with Repeater control in asp.net with C#.
Ankit Singh

Total Post:341

Posted on    October-30-2015 11:27 PM

 .NET C#  ASP.Net 

 1 Reply(s)
 745  View(s)
Rate this:
i am unable to bind data in Repeater control asp.net . how to do this please give me solution.

aditya kumar Patel

Total Post:254

Posted on    October-30-2015 11:49 PM

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.net.

<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



Don't want to miss updates? Please click the below button!

Follow MindStick