如何在vb.net中的gridview中添加图像 [英] how to add image in gridview in vb.net

查看:150
本文介绍了如何在vb.net中的gridview中添加图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生。我在运行时创建了一个Datatable并与gridview绑定。我想在datatable中添加一个图像,然后用gridview绑定。我的代码就是: -



Dim table As New DataTable

sir. i have create a Datatable at runtime and bind with gridview. i want to add a image in datatable then bind with gridview. My code for example is there:-

Dim table As New DataTable

table.Columns.Add("Teacher", GetType(String))
       table.Columns.Add("Course", GetType(String))





table = GetTable(老师,课程)



table = GetTable(Teacher, Course)

GridView1.DataSource = table
      GridView1.DataBind()
      table.Dispose()
















Public Function GetTable(ByVal Teacher As String, ByVal Course As String, ByVal Subject As String, ByVal Sem As String) As DataTable

cmd.commandtext="select * from Teacher"
     table.Rows.Add(Teacher, Course)

       Return table

   End Function







如何在数据表的新列中添加i图像然后用gridview绑定?




how can i add i image in new column in datatable and then bind with gridview?

推荐答案

这可能对你有帮助..



Display-Images-in-GridView-Control 的[< a href =http://www.aspsnippets.com/Articles/Display-Images-in-GridView-Control-u sing-the-path-stored-in-SQL-Server-database.aspxtarget =_ blanktitle =New Window> ^ ]
this might help you..

Display-Images-in-GridView-Control[^]


在ASP中。 NET GrideView您可以根据需要定义列 - 其中一个选项是ImageFiled ...

查看本教程如何执行此操作 - http://msdn.microsoft.com/en-us/library/aa479350.aspx [ ^ ]
In ASP.NET GrideView you can define your columns as you wish - one of the options is ImageFiled...
Check this tutorial on how to do this - http://msdn.microsoft.com/en-us/library/aa479350.aspx[^]


这篇关于如何在vb.net中的gridview中添加图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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