I am trying to bind data from SQL to a repeater control. I have tried what I usually do for a Gridview and it doesn't work. I would like to see an example whether it be using an SQLAdapter or using ExecuteReader from a command. Thank you!
string sql = "SELECT [WallPost], [DatePosted] FROM [WallTable] WHERE [UserId] = '"
+ Request["friend"] + "'";
string strCon =
System.Web.Configuration.WebConfigurationManager.ConnectionStrings["SocialSiteConnectionString"].ConnectionString;
SqlConnection conn = new SqlConnection(strCon);
SqlDataAdapter daUserProfile = new SqlDataAdapter(sql, conn);
dsSocialSite.UserProfileDataTable tbUserProfile =
new dsSocialSite.UserProfileDataTable();
daUserProfile.Fill(tbUserProfile);
rpWall2.DataSource = tbUserProfile; //rpWall2 = repeater control
rpWall2.DataBind();