Sunday, September 2, 2018

DATALIST IMAGE IN HORIZONTAL FORMAT

<asp:DataList ID="dlstmovie" runat="server"   RepeatColumns="3"    RepeatDirection="Horizontal" Width="490px" CellPadding="2" CellSpacing="2">
 
<ItemTemplate>
     
           <img alt="" src='Admin/indexing/<%#Eval("fname") %>'  Height="80px"   Width="209px" />

 </ItemTemplate>
 
</asp:DataList>



C#  Code

  SqlConnection cn;
    SqlCommand cm;

    SqlDataReader dr;


    protected void Page_Load(object sender, EventArgs e)
    {

        string cs = ConfigurationManager.ConnectionStrings["Journal_db"].ToString();
     


        if (!this.IsPostBack)
        {

            cn = new SqlConnection(cs);
            cn.Open();

            cm = new SqlCommand("select * from aindextab", cn);
            DataSet ds = new DataSet();
            SqlDataAdapter da = new SqlDataAdapter(cm);
            da.Fill(ds);

            dlstmovie.DataSource = ds;
            dlstmovie.DataBind();
            cn.Close();



        }
    }





No comments:

Post a Comment

GRIDVIEW ON ROW DATA BOUND EVENT

 Database Create  Student : roll , name , city , cost  Fix 6 Value  in Database Record  ====================================================...