Import System.IO
Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
Try
Dim s As String = FileUpload1.PostedFile.FileName
Dim s1 As String = Path.GetFileName(s)
FileUpload1.PostedFile.SaveAs(Server.MapPath("img/" + s1))
Dim s2 As String = "../img/" + s1
da = New SqlDataAdapter("insert into move(title,director)values('" + TextBox1.Text + "','" + s2 + "')", cn)
ds = New DataSet()
da.Fill(ds)
GridView2.DataSource = ds
GridView2.DataBind()
Catch ex As Exception
Response.Write(ex.Message)
End Try
End Sub
Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
Try
Dim s As String = FileUpload1.PostedFile.FileName
Dim s1 As String = Path.GetFileName(s)
FileUpload1.PostedFile.SaveAs(Server.MapPath("img/" + s1))
Dim s2 As String = "../img/" + s1
da = New SqlDataAdapter("insert into move(title,director)values('" + TextBox1.Text + "','" + s2 + "')", cn)
ds = New DataSet()
da.Fill(ds)
GridView2.DataSource = ds
GridView2.DataBind()
Catch ex As Exception
Response.Write(ex.Message)
End Try
End Sub