try below
Using con1 As New SqlConnection(ConfigurationManager.ConnectionStrings("connection").ConnectionString)
Dim csvPath As String = Path.Combine(Server.MapPath("~/excel/") , Path.GetFileName(FileUpload1.PostedFile.FileName))
FileUpload1.SaveAs(csvPath)
con1.Open()
Dim queryimg As String = "BULK INSERT trycsv FROM '"+ csvPath + "'"
Dim cmdimg As New SqlCommand(queryimg, con1)
cmdimg.ExecuteNonQuery()
con1.Close()
End Using
I have include single quotes for file path
UPDATE:
As below
Kornfeld Eliyahu Peter pointed out about path,
above will work if your web server and the sql server both run on same sever/PC
check
Handling BULK Data insert from CSV to SQL Server[
^]
you can find sample code which you can bulk insert using csv reader and that will solve your issue.