c# winform 读取oracle中blob字段的图片显示到pictureBox里
来源:互联网 发布:异步加载js方案 编辑:程序博客网 时间:2024/05/17 22:23
private void button1_Click(object sender, EventArgs e)
{
OracleConnection conn = dbc.getConnection();//获得conn连接
try {
//重新连接数据库
conn.Open();
OracleCommand cmd = conn.CreateCommand();
cmd.CommandText = "select xp from user_xp where id = 12345 ";//查询获得图片流
OracleDataReader oddr = cmd.ExecuteReader();//创建一个OracleDateReader对象
oddr.Read();
MemoryStream ms = new MemoryStream((byte[])oddr["xp"]);
Image image = Image.FromStream(ms, true);
oddr.Close();
conn.Close();
pictureBox1.Image = image;
//已经连接好数据库(根据DataGridView里的ID查找数据库里的照片,显示在picturebox里)
// myDB = new DBTool(Conn);
//string tt = "";
//tt = "select xp from user_xp where picture_id='"+DataGridView.Rows[e.RowIndex].Cells[0].Value+"";
//OracleDataReader oddr = myDB.RunProcGetReader(tt);
//oddr.Read();
//MemoryStream ms = new MemoryStream((byte[])oddr["xp"]);
//Image image = Image.FromStream(ms, true);
//oddr.Close();
//myDB.Dispose();
// pictureBox1.Image = image;
//已经连接好数据库(直接从数据库里查找出图片,显示在picturebox里)
//byte[] bt = (byte[])DataGridView1.Rows[e.RowIndex].Cells[0].Value;
//Stream stream = new MemoryStream(bt);
//Bitmap bmp = (Bitmap)System.Drawing.Image.FromStream(stream);
//pictureBox1.Image = bmp;
}
catch (Exception ee)
{
MessageBox.Show(ee.Message.ToString());
}
}
- c# winform 读取oracle中blob字段的图片显示到pictureBox里
- c# winform 读取oracle中blob字段的图片并且显示到pictureBox里,保存进库
- C# winform 另存为picturebox里的图片
- JSP读取Oracle数据库里的图片Blob字段并显示在页面上
- c# winform pictureBox显示图片,PictureBox控件的Image属性
- c# winform pictureBox显示图片,PictureBox控件的Image属性
- 存在数据库里的图片直接显示到PictureBox中
- c# winform 操作oracle数据库的Blob字段,把图片存储到数据库,保存图片到数据库
- c#如何打印picturebox里的图片,winform怎样打印picturebox里的图片
- C#读取oracle的Blob字段
- c#读取Oracle的Blob字段
- 如何将pictureBox里的图片保存到数据库,然后从数据读取显示
- JAVA读取Oracle中的blob图片字段并显示
- JAVA读取Oracle中的blob图片字段并显示
- JAVA读取Oracle中的blob图片字段并显示
- JAVA读取Oracle中的blob图片字段并显示
- JAVA读取Oracle中的blob图片字段并显示
- JAVA读取Oracle中的blob图片字段并显示
- 2010年的第一场雪
- Extjs和Asp.NET后台的数据交互(二) => Ext.data.Connection
- server list
- sql之left join、right join、inner join的区别
- 实际开发中可能用到的PHP的字符串操作函数(总结)
- c# winform 读取oracle中blob字段的图片显示到pictureBox里
- DB Optimizer 简介
- JavaScript验证大全
- 是否该读博士(ZZ)
- linux下java安装
- 读不读博
- 常用的WebServices
- MySQL存储引擎
- PPPoE常见拨号错误代码分析及解决办法