以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]使用二进制头像新增行时提示未保存不能提取(已解决)?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=128279)

--  作者:lunengcheng
--  发布时间:2018/12/3 9:28:00
--  [求助]使用二进制头像新增行时提示未保存不能提取(已解决)?
各位老师前辈,请教一下,我使用二进制图片保存头像,然后新增行时提示“新增行必须先保存,然后才能提取或设置后台数据”,请问怎么解决这个问题,下面是窗口AfterLoad的代码?

\'头像管理
Dim pbx As WinForm.PictureBox = Forms(e.Form.Name).Controls("PictureBox1")
If Tables(e.Form.Name.replace("二级","") & "_Table1").Current Is Nothing Then
    pbx.Image = Nothing
Else
    pbx.Image = Tables(e.Form.Name.replace("二级","") & "_Table1").Current.DataRow.SQlLoadImage("头像") \'从后台提取头像并显示
End If
[此贴子已经被作者于2018/12/3 12:11:09编辑过]

--  作者:有点甜
--  发布时间:2018/12/3 9:32:00
--  
Dim pbx As WinForm.PictureBox = Forms(e.Form.Name).Controls("PictureBox1")
Dim r As Row = Tables(e.Form.Name.replace("二级","") & "_Table1").Current
If r Is Nothing OrElse r.DataRow.RowState = DataRowState.Added Then
    pbx.Image = Nothing
Else
    pbx.Image = r.DataRow.SQlLoadImage("头像") \'从后台提取头像并显示
End If

--  作者:lunengcheng
--  发布时间:2018/12/3 12:11:00
--  
代码可用,多谢老师!