Results 1 to 16 of 16

Thread: asp could not find a part of the path

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2011
    Posts
    17

    asp could not find a part of the path

    hi there,
    i have a problem. i have searched this isue to see if it was posted but i could not find any solutions.
    a try to import excel file into msql. it was working just fine but now a have two erros:
    - asp could not find a part of the path
    - unspecified error

    on test server its working ok but on production server i get this errors.
    please some help
    thank you very much

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: asp could not find a part of the path

    Are you using ASP, ASP.NET?
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Feb 2011
    Posts
    17

    Re: asp could not find a part of the path

    asp.net
    thanx

  4. #4
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,289

    Re: asp could not find a part of the path

    Quote Originally Posted by silviufn View Post
    hi there,
    i have a problem. i have searched this isue to see if it was posted but i could not find any solutions.
    a try to import excel file into msql. it was working just fine but now a have two erros:
    - asp could not find a part of the path
    - unspecified error

    on test server its working ok but on production server i get this errors.
    please some help
    thank you very much
    No code = not able to help you further...
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Feb 2011
    Posts
    17

    Re: asp could not find a part of the path

    the code seems to be ok. it was workin just fine. but lately i get this error. thanx

    If FileUpload1.FileName <> "" Then
    If Session("Import") = "Cazare" Then

    GridView1.Visible = True
    Dim sSQLTable As String = "tbl_TM_TempTableForCazareDanubiusExcelImport"
    'Dim sExcelFileName As String = ""
    'sExcelFileName = FileUpload1.PostedFile.FileName
    'Dim sExcelFileName As String = Server.MapPath("~") + "\" + FileUpload1.FileName

    Dim sExcelFileName As String = "F:\Danubius\" + FileUpload1.FileName ' PROD

    Me.hfExcelFileName.Value = FileUpload1.FileName

    FileUpload1.SaveAs(sExcelFileName)
    Dim sWorkbook As String = "[Raport$]"
    Dim sExcelConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sExcelFileName & ";Extended Properties=""Excel 8.0;HDR=YES;"""
    'Dim sExcelConnectionString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & sExcelFileName & ";Extended Properties=""Excel 12.0;"""
    Dim sSqlConnectionString As String = WebConfigurationManager.ConnectionStrings("TravelManagementConnectionString").ToString
    'Me.txtMsgErr.Text = "helllo" 'sExcelConnectionString + ";" + sExcelFileName
    'OleDbConn = New OleDbConnection(sExcelConnectionString)
    OleDbConn.ConnectionString = sExcelConnectionString
    Dim OleDbCmd As OleDbCommand = New OleDbCommand(("SELECT * FROM " & sWorkbook), OleDbConn)


    'Create our connection strings
    'Execute a query to erase any previous data from our destination table
    Dim sClearSQL = "DELETE FROM " & sSQLTable
    Dim SqlConn As SqlConnection = New SqlConnection(sSqlConnectionString)
    Dim SqlCmd As SqlCommand = New SqlCommand(sClearSQL, SqlConn)
    SqlConn.Open()
    SqlCmd.ExecuteNonQuery()
    SqlConn.Close()
    OleDbConn.Close()

    Try
    OleDbConn.Open()
    Catch ex As Exception
    OleDbConn.Close()
    'Me.txtMsgErr.Text = "fff"
    strer = MesgBox.script(ex.Message.ToString)
    ClientScript.RegisterStartupScript(strer.GetType(), "Eroare", strer)
    End Try

    'If ConnectionState.Broken Then
    ' Throw New Exception()
    'End If

    Dim dr As OleDbDataReader = OleDbCmd.ExecuteReader()
    Dim bulkCopy As SqlBulkCopy = New SqlBulkCopy(sSqlConnectionString)

    bulkCopy.DestinationTableName = sSQLTable
    bulkCopy.ColumnMappings.Add(0, "Delegatie")
    bulkCopy.ColumnMappings.Add(15, "NrFactura")
    bulkCopy.ColumnMappings.Add(16, "DataFactura")
    bulkCopy.ColumnMappings.Add(11, "Localitate")
    bulkCopy.ColumnMappings.Add(10, "NrNopti")
    bulkCopy.ColumnMappings.Add(8, "DataInceputServiciu")
    bulkCopy.ColumnMappings.Add(9, "DataSfarsitServiciu")
    bulkCopy.ColumnMappings.Add(13, "DocumentCost")
    bulkCopy.ColumnMappings.Add(22, "Cazare")
    bulkCopy.ColumnMappings.Add(23, "TVACazare")
    bulkCopy.ColumnMappings.Add(24, "TaxaTranzactie")
    bulkCopy.ColumnMappings.Add(25, "TVATaxaTranzactie")
    bulkCopy.WriteToServer(dr)

    OleDbConn.Close()
    SqlDataSource1.DataBind()
    GridView1.DataBind()

    FileUpload1.Visible = False
    Button1.Visible = False

    End If
    End If

  6. #6
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,289

    Re: asp could not find a part of the path

    1st error is most likely caused by an IOException (i.e. non existent folder, the account that runs the web app doesn't have write permission to that directory...) Does the directory F:\Danubius exist? If it does then does the uploaded file get saved in F:\Danubius\ folder?

    2nd error is the result of the 1st error. You assume that everything went well and the uploaded file had been saved to its destination. What if the uploaded file failed to be saved?
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Feb 2011
    Posts
    17

    Re: asp could not find a part of the path

    the folder exist. and yes the uploaded file is saved.

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Feb 2011
    Posts
    17

    Re: asp could not find a part of the path

    last time i tried to import the file on the production application gave me this error. and i saw the file saved on F:\danubius folder
    After that i ran it in debugger and imported from a local path. that's my workaround for the moment

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Feb 2011
    Posts
    17

    Re: asp could not find a part of the path

    UNSPECIFIED ERROR. i saw other people having on this problem
    http://support.microsoft.com/kb/827190

  10. #10
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,289

    Re: asp could not find a part of the path

    So where (which line) does it throw the exception then?
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  11. #11

    Thread Starter
    Junior Member
    Join Date
    Feb 2011
    Posts
    17

    Re: asp could not find a part of the path

    it doesn,t show ...because the error apears only in production. just a message with

    Name:  UNSPECIFIED ERROR.jpg
Views: 329
Size:  8.1 KB

  12. #12
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: asp could not find a part of the path

    Quote Originally Posted by silviufn View Post
    UNSPECIFIED ERROR. i saw other people having on this problem
    Is that still related to the original problem?

    Edit:

    Quote Originally Posted by silviufn View Post
    it doesn,t show ...because the error apears only in production. just a message with
    Have you tried running the release version of the site on the development machine?
    Last edited by Nightwalker83; Jun 25th, 2014 at 03:59 AM. Reason: Adding more!
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  13. #13
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,710

    Re: asp could not find a part of the path

    Thread Moved
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  14. #14

    Thread Starter
    Junior Member
    Join Date
    Feb 2011
    Posts
    17

    Re: asp could not find a part of the path

    yes. is the same version.

  15. #15

    Thread Starter
    Junior Member
    Join Date
    Feb 2011
    Posts
    17

    Re: asp could not find a part of the path

    hi there,
    this thread can be close.

  16. #16
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,020

    Re: asp could not find a part of the path

    hi there,
    this thread can be close.
    You mean this thread is resolved? if yes, mark this thread as resolved..

    KGC
    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width