Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2009
    Posts
    6

    Unanswered: Unable to connect Database - Login Failed

    Hello ALL

    i have a scenario, where i am hosting a ASP.NET website which is using SQL 2005 DB, additionally i have made a .udl link file which is linking the same DB.

    Now, Website is open on localhost and accessing Database contents and if subsequently we try to test connection using my .udl link file it shows one of the 2 errors below:

    1. Login Failed.........
    2. Test Connection failed because of an error in initializing provider. Unable to open the physical file "...." .OS error 32(process cannot access the file as it is being used by another process.)

    Please help me resolve this problem.

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Are you sure you are not using MS Access as a database? I have never known SQL Server to give the second error.

  3. #3
    Join Date
    Jul 2009
    Posts
    6
    Yes i am sure i am using SQL database in my project.

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    The problem lies inside your UDL file. That's where you need to find the problem and fix it.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  5. #5
    Join Date
    Jul 2009
    Posts
    6
    thanks for the reply

    Actually, .udl file works perfectly fine if i have not browsed the website and even i have verified this by writing a small C# utility where i am trying to read data back from the same database.

  6. #6
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I'm still pretty sure that the problem lies in your UDL file, although based on the fact that the UDL file works by itself (which still leaves it as a possible culprit), the problem could also be in your web site. I still lean very heavily toward the problem being somewhere in the UDL file.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  7. #7
    Join Date
    Jul 2009
    Posts
    6
    May be i am also trying to find the cause of the problem.
    I think i can help you with some more information like

    Website has got a SQL database to which i connect and disconnect on many operations. Website has got 2 types of database interaction
    1. Using Code in C# with SqlConnection and other classes
    2. Using SqlDataSource.

    In method "1" i have checked that whenever a connection is opened it is also closed but in "2" method SqlDatasource is binded with some controls like gridview which handles all the connections on its own.

    Now the problem is here, i open the website and retrieve data on the gridview and than close the browser window. Now id i check the DB connection using my udl file or the small test app which i have made it gives me one of the 2 errors earlier stated.

  8. #8
    Join Date
    Jul 2009
    Posts
    6
    Hello

    Some more info
    When i start the browser and open the website Link, process named "aspnet_wp.exe" starts But when i exit from site and close the browser window the process still remains and is holding some connection as well which is responsible for the error. As soon as i forcefully close the "aspnet_wp" and than test connection, it works fine.

    please let me know if i am going into right direction with ur suggestions.

    Regards
    Goel

Posting Permissions

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