|
-
Oct 16th, 2007, 10:29 PM
#1
Thread Starter
Lively Member
[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
-
Oct 17th, 2007, 05:55 AM
#2
-
Oct 17th, 2007, 08:32 AM
#3
Junior Member
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
-
Oct 17th, 2007, 08:46 AM
#4
Re: Connection Problem
 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
-
Oct 17th, 2007, 09:24 AM
#5
Thread Starter
Lively Member
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.
-
Oct 17th, 2007, 10:57 AM
#6
-
Oct 17th, 2007, 01:10 PM
#7
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.
-
Oct 17th, 2007, 02:40 PM
#8
Thread Starter
Lively Member
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
-
Oct 17th, 2007, 03:10 PM
#9
-
Oct 17th, 2007, 10:04 PM
#10
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|