I have some confusion as to the use of + and & in ASP.NET and VB.NET. See the following code:
Dim dtUser As DataTable = GetDetails()
Dim serverPath As String = Nothing
Dim virtualServerPath As String = Nothing
Dim parentDir As DirectoryInfo = Nothing
Dim childDir As DirectoryInfo = Nothing
serverPath = Page.Server.MapPath(".") + "\"
virtualServerPath = serverPath.Substring(0, serverPath.LastIndexOf("\"))
virtualServerPath = virtualServerPath + "\SiteImages\" + dtUser.Rows(0)("Name")
parentDir = Directory.CreateDirectory(virtualServerPath)
childDir = parentDir.CreateSubdirectory(Session("RegID"))
Dim strUserName as String=dtUser.Rows(0)("Name")
If flUpload.HasFile Then
flUpload.SaveAs(Server.MapPath("~/SiteImages/" & dtUser.Rows(0)("Name") & "/" & childDir + "/" + flUpload.FileName))
I am getting error concerned with usage of + and & in
flUpload.SaveAs(Server.MapPath("~/SiteImages/" & strUserName & "/" & childDir + "/" + flUpload.FileName))
Can anybody help to remove the error