Repeater With Server Side Method Bind Records.

Jayakumars
Posted by Jayakumars under ASP.NET AJAX category on | Points: 40 | Views : 897
hi

I have post Repeater With Server Side Method Bind Records.

public DataTable bindgridds()
{

DataTable dt1 = new DataTable();


SqlConnection con = new SqlConnection(strConnString);
con.Open();
str = "Select * from Tbl_Emp";
com = new SqlCommand(str, con);
sqlda = new SqlDataAdapter(com);
dt1 = new DataTable ();
sqlda.Fill(dt1);
con.Close();
return dt1;
}

<asp:Repeater ID="ree1" runat ="server" >
<ItemTemplate>
<asp:Label ID="lbl1" runat ="server" Text ='<%# Bind("EmpName") %>' ></asp:Label>
<asp:DropDownList od="Drp1" runat ="server" DataTextField ="EmpName" DataValueField ="EmpId" DataSource ='<%# bindgridds() %>' ></asp:DropDownList>
</ItemTemplate>
</asp:Repeater>

Comments or Responses

Login to post response