Skip to content
Loading
give me solution in c#
  • Amit Kumar
    Hi,
     
    First get the image name from database and bind the gridview using image tag.
    here is the a logical point if you store only image name in your database or whole path if
    you store whole path of the image then it bind easily, if you store only image name then bind path hardcode in image tag and then bind your image name.
     
    if you get whole path then use.
     
    Height="80px" Width="100px" />
     
    if you get only image name then use like.
     
    Height="80px" Width="100px" />
     
    Regards,
    Amit
    0
  • Laxmidhar Sahoo
    private void Form2_Load(object sender, EventArgs e)
    {
    con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Admin\source\repos\DATABASE\data2.sql.mdf;Integrated Security=True;Connect Timeout=30");
    con.Open();
    adpt = new SqlDataAdapter("Select * from Details ", con);
    ds = new Dataset();
    adpt.Fill(ds);
    dataGridView.DataSource = ds.tables[0];
    con.Close();
    }
    0