请问老师,我下面的代码为什么:
1、信息写不到“职工信息总表”中;
2、如何把照片写入照片列呢?
3、想用照相和照片代码怎么写。
Case "zgxxlr.htm"
If e.PostValues.Count = 0 Then
wb.AddForm("","form1","addnew.htm")
With wb.AddInputGroup("form1","ipg1","教职工信息")
.AddInput("姓名","姓名","Text") '前一个"姓名"是ID,后一个"姓名"是标题
.AddInput("性别","性别","男|女")
.AddInput("出生日期","出生日期","date")
.AddInput("籍贯","籍贯","Text")
.AddSelect("民族","民族","汉族|回族|其它")
.AddSelect("编制","编制","农村初中|农村小学|无编制")
.AddSelect("任教学科","任教学科","语文|数学|英语|物理|化学|生物|政治|历史|地理|体育|美术|音乐|信息技术|科学|综合实践")
.AddInput("政治面貌","政治面貌","TEXT")
.AddSelect("职称_职级","最高职称","副高级教师|一级教师|二级教师")
.AddSelect("最高学历","最高学历","中专|大专|本科|硕士")
.AddUploader("up1","照片",True) 'True表示允许上传多个文件
End With
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "确定", "submit")
End With
e.WriteString(wb.Build)
Else
Dim nms() As String = {"姓名","性别","出生日期","籍贯","民族","编制","任教学科","政治面貌","职称_职级","最高学历"}
Dim dr As DataRow = DataTables("职工信息总表").AddNew()
For Each nm As String In nms
dr(nm) = e.PostValues(nm)
Next
For Each key As String In e.Files.Keys
If key = "up1" Then
For Each fln As String In e.Files(key)
e.SaveFile(key, fln, "D:\xxsjk(学校数据库)\学校档案\教师照片\" & fln)
Next
dr.Lines("照片") = e.Files(key)
End If
Next
'保存并生成增加成功提示页面
dr.save()
With wb.AddMsgPage("","msgpage","增加成功") '生成成功提示页
.AddButton("btn1","继续增加","addnew.htm")
End With
e.WriteString(wb.Build)
End If