/ Published in: ASP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<form id="form1" runat="server"> <div> <asp:Repeater ID="Repeater1" runat="server"> <ItemTemplate> <%# DataBinder.Eval(Container.DataItem, "Name") %> <br /> </ItemTemplate> </asp:Repeater> </div> </form> ------- private string connString; private OracleConnection cs; OracleDataAdapter da = new OracleDataAdapter(); protected void Page_Load(object sender, EventArgs e) { DataTable dt = new DataTable(); connString = ConfigurationManager.ConnectionStrings["Dev Connection"].ConnectionString; cs = new OracleConnection(connString); OracleCommand oraclecmd = new OracleCommand("select name from i2mslive.zone order by name", cs); cs.Open(); da.SelectCommand = oraclecmd; da.Fill(dt); cs.Close(); Repeater1.DataSource = dt; Repeater1.DataBind();