【发布时间】:2014-03-21 03:35:45
【问题描述】:
大家好,我在从数据库中显示 vb.net 上的数据时遇到问题。这是我的问题,我想通过路径在 vb.net 上显示图像。但是记录中没有图像,它将下降到我将通过路径将其修复为图像的状态 (对不起,我的英语不好。)
Public Sub DisplayData()
txtID.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(0)
txtlname.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(1)
txtfname.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(2)
txtmid.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(3)
txtstreet.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(4)
txtBarang.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(5)
txtcity.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(6)
txtzip.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(7)
cmbGender.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(8)
txtcontact.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(9)
txtemail.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(10)
cmbmonth.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(11)
cmbday.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(12)
cmbyear.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(13)
txtage.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(14)
cmbmarital.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(15)
txtemerlname.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(16)
txtemerfname.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(17)
txtemercontact.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(18)
cmbcourse.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(19)
cmbmeet1.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(20)
cmbmeet2.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(21)
cmbmeet3.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(22)
cmbfrom.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(23)
cmbto.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(24)
txtPath.Text = DSDrvSchool.Tables("Command Out").Rows(Index).Item(25)
'pbImage.Image = Image.FromFile(DSDrvSchool.Tables("Command Out").Rows(Index).Item(25))
If txtage.Text Is Nothing Then
pbImage.Image = Image.FromFile("D:\JCH Folder\Programming\My1stSystem\DrivingSchoolManagementSystem\Database\Photos")
Else
pbImage.Image = Image.FromFile(DSDrvSchool.Tables("Command Out").Rows(Index).Item(25))
End If
End Sub
【问题讨论】:
标签: vb.net vb.net-2010