标题:小学生求指教,谢谢各位大神帮忙看看
取消只看楼主
pisces零
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2015-12-15
 问题点数:0 回复次数:1 
小学生求指教,谢谢各位大神帮忙看看
怎么在点击save操作后将上传的源文件文件名和文件路径保存到数据库
Protected Sub Button_FileUpload1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim IntlsUF As Integer
        IntlsUF = 1
 IF file.HasFile=true  THen
            Dim strFileTName As String
            strFileTName=file.PostedFile.FileName
                    Try         
                file.SaveAs(Server.MapPath("~/legacy/TEST/test/") + strFileTName)
            Catch ex As Exception
               Label1.Text = IntlsUF.ToString            
          End Try            
                                if IntlsUF = 1 then
                Label1.Text = "文件上传成功"
                Label1.Text += "<Br/>"
                Label1.Text += "<li>" + "原文件路径:" + strFileTName                              
            Else
             Label1.Text = "文件上传失败" + IntlsUF.ToString
            End If
        End If
        
    End Sub
                                

    Protected Sub Button_Save_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Me.Button_Save.Enabled = False
        If Me.TextBox_Insert_Customer.Text <> "" Then
            Me.TextBox_Insert_Customer.Text = Me.TextBox_Insert_Customer.Text.Trim
            Me.TextBox_Insert_Customer.Text = Me.TextBox_Insert_Customer.Text.ToUpper
        End If
        If Me.TextBox_Insert_RPTID.Text <> "" Then
            Me.TextBox_Insert_RPTID.Text = Me.TextBox_Insert_RPTID.Text.Trim
            Me.TextBox_Insert_RPTID.Text = Me.TextBox_Insert_RPTID.Text.ToUpper
        End If
        Try
            Me.sdDaily_Manage.Insert()
            Me.gvDaily_Mange.DataBind()
        Catch ex As Exception
            'MsgBox(ex.Message)
            Me.ClientScript.RegisterStartupScript(Me.GetType(), "Startup", BuildWarning(ex.Message))
            'Response.Write ( ex.Message)
            'Response.End
        End Try
        Me.TextBox_Insert_Customer.Text = ""
        Me.TextBox_Insert_RPTID.Text = ""
        Me.TextBox_Insert_Description.Text = ""
        Me.Button_Save.Enabled = True
    End Sub
搜索更多相关主题的帖子: 数据库 Object 小学生 源文件 
2015-12-16 11:43
pisces零
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2015-12-15
得分:0 
在线等,
2015-12-16 11:45



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-460272-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.230854 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved