检索图像时出现问题 [英] problem in retriving image

查看:81
本文介绍了检索图像时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在从访问数据库中检索图像时面临prblm.我正在使用给定的代码检索图像:

i am facing prblm in retriving image from access database. I am using the given code for the retrival of image:

private void comboBox3_SelectedIndexChanged(object sender, EventArgs e)
       {
             OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|/furnituredb.mdb");
con.open();
            cmd = new OleDbCommand("select Image from AddTexture where Name='" +            comboBox3.Text + "'", con);
            da = new OleDbDataAdapter(cmd);
            ds = new DataSet();
            da.Fill(ds);
            byte[] MyData = new byte[0];
            DataRow myRow;
            myRow = ds.Tables[0].Rows[0];
            MyData = (byte[])myRow[0];
            MemoryStream str = new MemoryStream(MyData);
            pictureBox7.Image = Image.FromStream(str);
            pictureBox7.SizeMode = PictureBoxSizeMode.StretchImage;

            con.Close();
        }


错误是:参数无效


Error is:Parameter is not valid

推荐答案

尝试 http://www. aspfree.com/c/a/ASP.NET/Retrieving-Images-from-a-Database--C---Part-II/ [ http://www.daniweb.com/forums/thread158243.html [ http://www.eggheadcafe.com/community/aspnet/2/10085750/upload-the-image-to-folder-and-also-to-the-database.aspx [ http://www.daniweb.com/forums/thread248427.html [
Try handler[^] to retrieve your image from database.

For more information refer the links below:

Retrive a Image from Database
http://www.aspfree.com/c/a/ASP.NET/Retrieving-Images-from-a-Database--C---Part-II/[^]
http://www.daniweb.com/forums/thread158243.html[^]

Store a Image into Folder
http://www.eggheadcafe.com/community/aspnet/2/10085750/upload-the-image-to-folder-and-also-to-the-database.aspx[^]
http://www.daniweb.com/forums/thread248427.html[^]


--Amit


这篇关于检索图像时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆