private void button1_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(); con.ConnectionString = (@"Data Source=EUNIK-705F2C195\SQLEXPRESS;Initial Catalog=images;User ID=sa;Password=fintransys"); con.Open(); SqlCommand _sqlcommand = new SqlCommand("select Images from imagestore where ImageID='" + txt_EnterID.Text + "'", con); SqlDataAdapter _sqldataadapter = new SqlDataAdapter(_sqlcommand); DataSet _dataset = new DataSet(); DataTable _dataTable = new DataTable(); _sqldataadapter.Fill(_dataset,"imagestore"); int c = _dataset.Tables["imagestore"].Rows.Count; if(c>0) { Byte[] _Byte = new Byte[0]; _Byte = (Byte[])(_dataset.Tables["imagestore"].Rows[c - 1]["Images"]); MemoryStream _Memorystream = new MemoryStream(_Byte); pictureBox1.Image = Image.FromStream(_Memorystream); pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; pictureBox1.Refresh(); } con.Close(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)