Foxtable(狐表)用户栏目专家坐堂 → messagebox问题


  共有1732人关注过本帖树形打印复制链接

主题:messagebox问题

帅哥哟,离线,有人找我吗?
刘林
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:八尾狐 帖子:1936 积分:14844 威望:0 精华:0 注册:2016/4/28 9:58:00
messagebox问题  发帖心情 Post By:2016/12/8 17:11:00 [显示全部帖子]

Result = Messagebox.Show("是否确认导入到" & e.fORm.Controls("combobox1").value & "考试成绩表中","警告", MessageBoxButtons.YesNo, MessageBoxIcon.Question)

提示时选定的按钮是“是",能否选定的按钮是"否"

 回到顶部
帅哥哟,离线,有人找我吗?
刘林
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:八尾狐 帖子:1936 积分:14844 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2016/12/8 21:24:00 [显示全部帖子]

Dim Result As DialogResult
Result = Messagebox.Show("是否确认导入到" & e.fORm.Controls("combobox1").value & "考试成绩表中","警告", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)
If Result = DialogResult.YES Then 
Dim dlg As new OpenFileDialog
dlg.Filter = "Excel|*.xls;*.xlsx"
Dim ksmc As String = trim(e.Form.controls("combobox1").value)
Dim cmd As new SQLCommand
cmd.C
cmd.CommandText = "Sele  ct * from{成绩} where 考试名称 = '" & ksmc & "'"
Dim dt As DataTable = cmd.ExecuteReader(True)
If dlg.ShowDialog = DialogResult.OK Then
    Dim Book As New XLS.Book(dlg.FileName)
    Dim Sheet As XLS.Sheet = Book.Sheets(0)
    Dim str As String = trim(e.Form.controls("combobox1").value) 
    If sheet(0,0).value.Contains(str) Then
    For n As Integer = 2 To Sheet.Rows.Count -1
        Dim dr As DataRow = dt.find("考试名称 = '" & ksmc & "' and 考号 = '" & trim(sheet(n,0).value) & "'")
        If dr IsNot Nothing Then
            For m As Integer = 1 To sheet.Cols.count -1
                dr(trim(sheet(1,m).value) & "_B") = val(sheet(n,m).value)
            Next
        End If
    Next
    dt.save
End If
DataTables("成绩").load
Else
Messagebox.Show("你所选择的EXCL表第一行不包含考试名称,有可能你选错了表或选错了考试名称","警告")
End If
End If

老师我设计时为了防止用户选表时出现选错样表,但测试mess不出现呢?


 回到顶部