从数据库中获取图像并使用c#在asp.net的网格视图中显示

时间:2013-11-01 04:09:12

标签: c# asp.net sql-server image

我有leafshape tableImage数据表有图像格式的图像

从表格中获取数据

public DataSet GetLeafShape(string con)
{
        string query = "SELECT * FROM LeafShape";

        try
        {
            return SqlHelper.ExecuteDataset(con, CommandType.Text, query);               
        }
        catch (SqlException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw ex;
        }
}

我想将此数据传递给gridview。我怎么能这样做?

我试试这个,但图片没有显示。如何将数据转换为图像?

GridViewleaf.DataSource = ds.Tables[0];
GridViewleaf.DataBind();

感谢。

0 个答案:

没有答案
相关问题