图像从数据库中逐个显示到Gridview中 [英] images display into the Gridview one by one from the Database

查看:70
本文介绍了图像从数据库中逐个显示到Gridview中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Gridview控件,有6列和6行。和一个数据库。我在我的数据库图像列中有一些图片。

i希望在我的girdview控件中逐个显示图像。

首先我想将数据库中的图像转换为二进制文件格式然后我想由处理程序在girdview上显示。请帮助我们

i have a Gridview control and there are 6 columns and 6 rows. and a database. and i have some pics in my database images columns.
i want to show one by one images inside my girdview control.
first i want to convert images inside the database into binary format and then i want to show on the girdview by the handler . please help me guys

推荐答案

首先将图像插入到dtabase中,然后在编码中裁剪图像。

使用webservices和jquery。



Supoose你有一张imageiD,ImageName等表格。



然后创建一个方法foreach select Image



First when images insert into dtabase crop the images in coding.
use the webservices and jquery.

Supoose tha you have a table that imageiD,ImageName etc.

then create a method foreach select Image

public string getAllImages()
{
if (user.identity.Isauthenticated)
{

ImageClass[] objclass=ImageClass.Get(convert.toint32(imageID));

if(objclass!=null)
{
foreach(Imageclass obj in objclass)
{
stringbuilder sb=new stringbuilder();
sb.Append("+obj.ImageName+");
}
}
return sb.tostring();

}
..................

then this service call on click useing jquery..


}


这篇关于图像从数据库中逐个显示到Gridview中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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