Return to Snippet

Revision: 31811
at September 14, 2010 02:17 by myke


Updated Code
SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM Product", ConfigurationManager.ConnectionStrings["ConnectionStringValue"].ConnectionString);
DataTable table = new DataTable();
adapter.Fill(table);
Repeater1.DataSource = table;
Repeater1.DataBind();

//Access data in .aspx with <%#Eval("fieldName")%>

Revision: 31810
at September 14, 2010 02:16 by myke


Initial Code
SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM Product", ConfigurationManager.ConnectionStrings["ConnectionStringValue"].ConnectionString);
DataTable table = new DataTable();
adapter.Fill(table);
Repeater1.DataSource = table;
Repeater1.DataBind();

Initial URL

                                

Initial Description
Old school or simple way of querying data without a DAL.

Initial Title
ASP.NET Query from codebehind (Old School)

Initial Tags
data, query, aspnet

Initial Language
C#