using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace YourProjectName
{
public partial class Info : MetroFramework.Forms.MetroForm
{
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
lbstdid.Text = dataGridView1.SelectedRows[0].Cells[0].FormattedValue.ToString();
txtname.Text = dataGridView1.SelectedRows[0].Cells[1].FormattedValue.ToString();
txtfname.Text = dataGridView1.SelectedRows[0].Cells[2].FormattedValue.ToString();
txtuser.Text = dataGridView1.SelectedRows[0].Cells[4].FormattedValue.ToString();
Database.DBGeneral ob = new Database.DBGeneral();
DataTable dt = new DataTable();
dt=ob.myTable("select Picture from Student_Registration where ID='" + int.Parse(lbstdid.Text) + "'");
pictureBox1.Image = bytetoimage((Byte[])dt.Rows[0]["Picture"]);
}
}
}