New Releases.ascx
I have used a datalist. Server controls like
imagebutton , a label and a hyperlink
have been included in a Item
Template column of the DataList..The
controls have been bound by the column elements used in the SQL query. Here’ s
the code.
private void
Page_Load(object sender, System.EventArgs e)
{
SqlConnection
objCon = new
SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
string sql = "Select top 10
pr.productid,pr.modelname,im.imagename,pr.dateadded from products pr,images im
where pr.productid = im.productid order by dateadded desc ";
SqlDataAdapter
objda = new SqlDataAdapter(sql,objCon);
DataSet
ds = new DataSet();
objda.Fill(ds);
dsNewReleases.DataSource
= ds; // Bind the dataset to
the datalist.
dsNewReleases.DataBind();
}