Results 1 to 9 of 9

Thread: Login failed for user ''. The user is not associated with a trusted SQL Server connec

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2007
    Posts
    144

    Question 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

  2. #2
    Hyperactive Member
    Join Date
    Sep 2006
    Location
    India
    Posts
    310

    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

  3. #3
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Oct 2007
    Posts
    144

    Re: Login failed for user ''. The user is not associated with a trusted SQL Server co

    Quote Originally Posted by sagarpassion View Post
    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;"/>

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Oct 2007
    Posts
    144

    Re: Login failed for user ''. The user is not associated with a trusted SQL Server co

    Quote Originally Posted by gep13 View Post
    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....

  6. #6
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  7. #7
    Hyperactive Member
    Join Date
    Sep 2006
    Location
    India
    Posts
    310

    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

  8. #8
    Lively Member
    Join Date
    Jul 2006
    Posts
    97

    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).

  9. #9
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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
  •  



Click Here to Expand Forum to Full Width