sanaz_amiri
یک شنبه 29 شهریور 1383, 11:56 صبح
If Not (pdf.PostedFile Is Nothing) Then
Try
'Dim fileName As String = System.IO.Path.GetExtension(Image_.PostedFile.File Name)
Dim fileName As String = System.IO.Path.GetFileName(pdf.PostedFile.FileName )
Dim destdir As String = Server.MapPath("../nomarat")
Dim destPath As String = System.IO.Path.Combine(destdir, fileName)
label1.Text += destPath
pdf.PostedFile.SaveAs(destPath)
If fileName <> "" Then
cmd = New SqlCommand("insert into tbleraeh (nomarat) values(fileName) where eraehcode='" & var1 & "'", conn)
'cmd = New SqlCommand("insert into tbleraeh (nomarat) values(fileName) where eraehcode=100", conn)
End If
Catch
cmd = New SqlCommand("insert into tbleraeh (nomarat) values(' nofile ') where eraehcode='" & var1 & "'", conn)
Finally
End Try
error::
The name 'fileName' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted
Try
'Dim fileName As String = System.IO.Path.GetExtension(Image_.PostedFile.File Name)
Dim fileName As String = System.IO.Path.GetFileName(pdf.PostedFile.FileName )
Dim destdir As String = Server.MapPath("../nomarat")
Dim destPath As String = System.IO.Path.Combine(destdir, fileName)
label1.Text += destPath
pdf.PostedFile.SaveAs(destPath)
If fileName <> "" Then
cmd = New SqlCommand("insert into tbleraeh (nomarat) values(fileName) where eraehcode='" & var1 & "'", conn)
'cmd = New SqlCommand("insert into tbleraeh (nomarat) values(fileName) where eraehcode=100", conn)
End If
Catch
cmd = New SqlCommand("insert into tbleraeh (nomarat) values(' nofile ') where eraehcode='" & var1 & "'", conn)
Finally
End Try
error::
The name 'fileName' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted