private void button2_Click(object sender, EventArgs e) { sql_sel s1 = new sql_sel(); s1.conn(); string sql = "select image From dbo.pic where ID='" + textBox1.Text + "'"; byte[] b = (byte[])s1.select(sql); File.WriteAllBytes(@"D:\read.gif", b); s1.close(); }
private void button1_Click(object sender, EventArgs e) { string teshuleixin = "@image"; sql_sel s1 = new sql_sel(); s1.conn(); string sql = "insert into dbo.pic(image) values (" + teshuleixin + ")"; s1.sql_insert(sql, byte1, teshuleixin); s1.close(); }
private void button3_Click(object sender, EventArgs e) { sql_sel s1 = new sql_sel(); s1.conn(); string sql = "select R示意图 From dbo.B示意图 where R所属台账编号='" + textBox1.Text + "'"; byte[] b = (byte[])s1.select(sql); MemoryStream ms = new MemoryStream(b); Image image = System.Drawing.Image.FromStream(ms); img_width_change a = new img_width_change(); image = a.change(image, pictureBox2.Width, pictureBox2.Height); pictureBox2.Image = image; s1.close(); }