|
-
Feb 11th, 2011, 01:56 AM
#1
Thread Starter
Addicted Member
Login failed for user ''. The user is not associated with a trusted SQL Server connec
i have published my application in hosting server through FTP.When i run my application locally,its running properly.
But after uploading files in hosting server,its showing error as
"Login failed for user ''. The user is not associated with a trusted SQL Server connection.".
I checked my code and found no errors in it.
URL:http://onlinesampleexams.com/Questionsdisplay.aspx
how can i resolve this error?
Thanks in advance,
Priya
-
Feb 11th, 2011, 01:58 AM
#2
Hyperactive Member
Re: Login failed for user ''. The user is not associated with a trusted SQL Server co
show your connection string.... with hidding server name and password...
Sagar
VB6, VB.net,C#,ASP, ASP.net MSSQL, MYSQL
-
Feb 11th, 2011, 02:32 AM
#3
Re: Login failed for user ''. The user is not associated with a trusted SQL Server co
Agreed. I would guess that this is one of two things...
1) You are still referencing the local instance of SQLExpress within your connection string, and you need to change this
2) You need to upload the contents of your local database (most likely a SQL Server Express Database) onto the SQL Server instance that is running on your web host.
Gary
-
Feb 11th, 2011, 02:47 AM
#4
Thread Starter
Addicted Member
Re: Login failed for user ''. The user is not associated with a trusted SQL Server co
 Originally Posted by sagarpassion
show your connection string.... with hidding server name and password...
hi my connection string
<add name="Hostingconnection" connectionString="Data source=servername;Integrated Security=SSPI;Initial Catalog=onlinesample;User Instance=true;"/>
-
Feb 11th, 2011, 03:00 AM
#5
Thread Starter
Addicted Member
Re: Login failed for user ''. The user is not associated with a trusted SQL Server co
 Originally Posted by gep13
Agreed. I would guess that this is one of two things...
1) You are still referencing the local instance of SQLExpress within your connection string, and you need to change this
2) You need to upload the contents of your local database (most likely a SQL Server Express Database) onto the SQL Server instance that is running on your web host.
Gary
Hi gary,
below is the connection string
<add name="Hostingconnection" connectionString="Data source=hostingservername;Integrated Security=SSPI;Initial Catalog=onlinesample;User Instance=true;user id=user;password=pwd"/>
and i could not get your second point..
can u please brief it?
Thanks....
-
Feb 11th, 2011, 03:02 AM
#6
Re: Login failed for user ''. The user is not associated with a trusted SQL Server co
Hello,
When you created the Database locally, were you using a SQL Server Express instance, and attaching the mdf file to it, or did you actually have a full SQL Server instance, with a contained database, and referencing it, as you are, in the connection string that you provided.
Basically what I am saying is, when you uploaded the site to the hosting provider, have you backed up and restored the database into their database server?
Gary
-
Feb 11th, 2011, 04:34 AM
#7
Hyperactive Member
Re: Login failed for user ''. The user is not associated with a trusted SQL Server co
gary is suggesting you that there are no records in your login details table...
Sagar
VB6, VB.net,C#,ASP, ASP.net MSSQL, MYSQL
-
Feb 16th, 2011, 06:57 AM
#8
Lively Member
Re: Login failed for user ''. The user is not associated with a trusted SQL Server co
I think you are trying to connect to your web app not from localhost, here is what I suggest to change because I have faced same problem :
<add name="Hostingconnection" connectionString="Data source=servername;Integrated Security=false;Initial Catalog=onlinesample;User Id=xxxx;Password=xxxx"/>
xxxx = in SQL server define new user to login with password (use SQL authentication).
-
Feb 16th, 2011, 07:44 AM
#9
Re: Login failed for user ''. The user is not associated with a trusted SQL Server co
For all things connection string related, have a look here:
http://connectionstrings.com/
Make sure that your connection string is valid.
Gary
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
|