zoukankan
html css js c++ java
从数据库读取图片,并固定显示
<
asp:datagrid id
=
"
DG_Persons
"
Width
=
"
168px
"
HeaderStyle
-
HorizontalAlign
=
"
Center
"
Runat
=
"
server
"
BorderColor
=
"
Black
"
ItemStyle
-
BackColor
=
"
Beige
"
HeaderStyle
-
ForeColor
=
"
#ffffff
"
HeaderStyle
-
Font
-
Bold
=
"
True
"
HeaderStyle
-
BackColor
=
"
#ff0000
"
AutoGenerateColumns
=
"
False
"
>
<
ItemStyle BackColor
=
"
Beige
"
></
ItemStyle
>
<
HeaderStyle Font
-
Bold
=
"
True
"
HorizontalAlign
=
"
Center
"
ForeColor
=
"
White
"
BackColor
=
"
Red
"
></
HeaderStyle
>
<
Columns
>
<
asp:TemplateColumn HeaderText
=
"
图片
"
>
<
ItemTemplate
>
<
asp:Image id
=
Image3 Height
=
"
186px
"
ImageUrl
=
'
<%# FormatURL(DataBinder.Eval(Container.DataItem, "imgid")) %>' Width="212px" Runat="server">
</
asp:Image
>
</
ItemTemplate
>
</
asp:TemplateColumn
>
</
Columns
>
</
asp:datagrid
>
Private
Sub BindGrid()
Sub
BindGrid(
ByVal
id)
Dim
strCnn
As
String
=
"
server=.;database=master1;uid=sa;pwd=
"
Dim
myConnection
As
SqlConnection
=
New
SqlConnection(strCnn)
Dim
dst
As
New
DataSet
Dim
sda
As
SqlDataAdapter
'
Dim myCommand As SqlCommand = New SqlCommand("SELECT * FROM image1 where imageid=" & i, myConnection)
sda
=
New
SqlDataAdapter(
"
SELECT * FROM KS_img where imgID=
"
&
id, myConnection)
'
myCommand.CommandType = CommandType.Text
dst.Clear()
sda.Fill(dst,
"
aaa
"
)
Try
myConnection.Open()
row
=
table.NewRow
'
row.Item("照片") = myCommand.ExecuteReader(CommandBehavior.CloseConnection)
row.Item(
"
imgid
"
)
=
dst.Tables(
"
aaa
"
).Rows(
0
).Item(
0
)
row.Item(
"
Img
"
)
=
dst.Tables(
"
aaa
"
).Rows(
0
).Item(
1
)
'
row.Item("PersonImage") = dst.Tables("aaa").Rows(0).Item(2)
'
row.Item("PersonImageType") = dst.Tables("aaa").Rows(0).Item(3)
table.Rows.Add(row)
table.GetChanges()
myConnection.Close()
Me
.DG_Persons.DataSource
=
table
Me
.DG_Persons.DataBind()
Catch
SQLexc
As
SqlException
Response.Write(
"
Error occured while Generating Data. Error is
"
&
SQLexc.ToString())
End
Try
End Sub
查看全文
相关阅读:
kubernetes添加不了google apt-key
The command 'xxx' returned a non-zero code: 100
gitlab autuo devops
zabbix监控流程图
xshell全局设置配色方案
设置行,列尺寸,权重weight(tkinter,Python3.x)
Tkinter 的 Text 组件
Python字符串颜色输出
tkinter Frame relief属性演示
Tkinter 的组件 PanedWindow
原文地址:https://www.cnblogs.com/fxf568/p/532944.html
最新文章
zip()和zip(*)方法(转载)
nn.parallel.replicate, scatter, gather, parallel_apply(转载)
cv2.namedWindow()函数
WiderFace数据集
centerface运行错误总结
5 使用ip代理池爬取糗事百科
4 使用Selenium模拟登录csdn,取出cookie信息,再用requests.session访问个人中心(保持登录状态)
3 使用selenium模拟登录csdn
2 模拟登录_Post表单方式(针对chinaunix有效,针对csdn失效,并说明原因)
1 网络爬虫_设置代理服务器
热门文章
4 关于word2vec的skip-gram模型使用负例采样nce_loss损失函数的源码剖析
3 TFRecord样例程序实战
2 (自我拓展)部署花的识别模型(学习tensorflow实战google深度学习框架)
1 如何使用pb文件保存和恢复模型进行迁移学习(学习Tensorflow 实战google深度学习框架)
增量调试的个人疑问,菜鸟求助!
k8s master init and add node
慢查询
zabbix通过执行自定义脚本script发送告警消息
kubernetes概念
inception安装
Copyright © 2011-2022 走看看