Posted By

myke on 09/14/10


Tagged

data query aspnet repeater old


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tyster


ASP.NET Query from codebehind (Old School)


 / Published in: C#
 

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

  1. SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM Product", ConfigurationManager.ConnectionStrings["ConnectionStringValue"].ConnectionString);
  2. DataTable table = new DataTable();
  3. adapter.Fill(table);
  4. Repeater1.DataSource = table;
  5. Repeater1.DataBind();
  6.  
  7. //Access data in .aspx with <%#Eval("fieldName")%>

Report this snippet  

You need to login to post a comment.