Results 1 to 10 of 10

Thread: [RESOLVED] Connection Problem

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2006
    Posts
    74

    Resolved [RESOLVED] Connection Problem

    I have made a project with a lot of forms. At home when I configured the data adapter the page runs fine. Let the name of the page here be "Page1.aspx". In my connection string I am using workstation id as localhost and data source as "(local)" so when I transfer it to another computer it should not give problem. I transfered the whole project to my work place here I reconfigured the data adapter and generated the dataset with the same workstation id and data source. Now when I run "Page1.aspx" at office computer it gives an error saying login failed for (sqlservername/ASPNET).

    This was the same error I was getting even at home when I made "Page2.aspx" and executed it. I thought maybe it was because of memory overload but now i am not sure. Can anyone help me solve this problem. If possible please also explain me why its happening and how to avoid it in the future. Thanks a lot

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Connection Problem

    Moved to ASP.NET

  3. #3
    Junior Member
    Join Date
    Oct 2007
    Posts
    22

    Re: Connection Problem

    I think that your problem stems from using two different SQL servers. You need to make sure that both have the same login that is in the connection string, and that the login has the rights to the databases that you are trying to use. If they do then you need to make sure that the SQL server allows the type of connection you are trying to make (ex. TCP/IP, Named Pipes, Ect.)

    Bradley

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Connection Problem

    Quote Originally Posted by Anup Singh
    so when I transfer it to another computer it should not give problem.
    That's not right, because when you're transferring to another machine you cannot assume that it has the same setup. In your case, I would first ask, does your office machine have SQL Server 2005/SQL Express installed on it?

    However, it does seem like you do have SQL Server installed, so the next step would be to check permissions. You should create a SQL User and password in SQL Server, and use that connection string.

    Look at some examples here:

    www.connectionstrings.com

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Apr 2006
    Posts
    74

    Re: Connection Problem

    I have same sql server it is sql server 2000. all other forms work ........ only that form not working
    Last edited by Anup Singh; Oct 17th, 2007 at 09:34 AM.

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Connection Problem

    Show your code then.

  7. #7
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724

    Re: Connection Problem

    The account that is being used to connect to your SQL Server instance doesn't have rights to the server - in this case "Machine name\ASPNET".
    You have two options:
    1) Add the ASPNET account to SQL Server, or
    2) Impersonate an account using the <identity> element in your web.config.

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Apr 2006
    Posts
    74

    Re: Connection Problem

    How to Add an account into SQL server .............. I am bad at configuration ...................... and for adding something in web.config file can you give me the code and tell me where to add ............
    My SQL server name is "Develop-5Floor" .............. but in my connection string i am using workstation id = localhost and data source = "(local)" I was told this would make transfer of files easier from one comp to another

  9. #9

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Apr 2006
    Posts
    74

    Re: Connection Problem

    Thanks Everyone. It Worked. Special Thanks To axion_sa You actually brought it home. Been trying to find the problem for three days. Checked every word of the code I was sure it was perfect no problem there. But couldn't figure out how to solve this. Should have come here earlier I guess

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