您的位置:首页 > 数据库

C# 对SQL Server中Image字段的读写(2)

2009-08-17 20:43 281 查看
上篇读取过会,显示时代码如下:

SqlConnection conn = new SqlConnection("Server=.;DataBase=student;Integrated Security=true;");

SqlCommand comm = new SqlCommand("select * from [Name]", conn);

SqlDataAdapter da = new SqlDataAdapter(comm);

DataSet ds = new DataSet();

da.Fill(ds, "Name");

MemoryStream ms = new MemoryStream((byte[])ds.Tables[0].Rows[4][2]);

pictureBox2.SizeMode = PictureBoxSizeMode.Zoom;

pictureBox2.Image = Image.FromStream(ms);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: