Failed to generate a user instance of SQL Server. Only an integratedconnection can generate a user i

Discussion in 'ASP .Net' started by Harlan Messinger, Mar 27, 2010.

  1. I'm using Visual Studio 2008 and SQL Server Express 2008. I've built the
    beginnings of an ASP.NET 3.5 app that reads a connection string from the
    configuration, in the usual way, and I can use LINQ-to-SQL against it
    and output listings of data from the database to a page with no problem.

    But I've created a custom membership provider that uses this string to
    create a data context for LINQ-to-SQL, and placed a Login control on a
    page that uses this membership provider. This page opens fine when I run
    it from Visual Studio, but when I enter some text into the login form
    and submit it, the error message "Failed to generate a user instance of
    SQL Server. Only an integrated connection can generate a user instance."
    appears in the browser. Visual Studio, meanwhile, doesn't give me any
    indication that there's a problem. The details under the error message
    in the browser go on about the App_Data directory, but my App_Data
    directory is empty and I haven't referred to it anywhere.

    Any ideas on the source of the trouble?
    Harlan Messinger, Mar 27, 2010
    #1
    1. Advertising

  2. Never mind, Re: Failed to generate a user instance of SQL Server.Only an integrated connection can generate a user instance.

    Harlan Messinger wrote:
    > I'm using Visual Studio 2008 and SQL Server Express 2008. I've built the
    > beginnings of an ASP.NET 3.5 app that reads a connection string from the
    > configuration, in the usual way, and I can use LINQ-to-SQL against it
    > and output listings of data from the database to a page with no problem.
    >
    > But I've created a custom membership provider that uses this string to
    > create a data context for LINQ-to-SQL, and placed a Login control on a
    > page that uses this membership provider. This page opens fine when I run
    > it from Visual Studio, but when I enter some text into the login form
    > and submit it, the error message "Failed to generate a user instance of
    > SQL Server. Only an integrated connection can generate a user instance."
    > appears in the browser. Visual Studio, meanwhile, doesn't give me any
    > indication that there's a problem. The details under the error message
    > in the browser go on about the App_Data directory, but my App_Data
    > directory is empty and I haven't referred to it anywhere.
    >
    > Any ideas on the source of the trouble?


    I had neglected to set the MembershipProvider property on the control!
    Sorry.
    Harlan Messinger, Mar 27, 2010
    #2
    1. Advertising

  3. Harlan Messinger

    John Bell Guest

    Re: Failed to generate a user instance of SQL Server. Only an integrated connection can generate a user instance.

    On Sat, 27 Mar 2010 11:18:56 -0400, Harlan Messinger
    <> wrote:

    >I'm using Visual Studio 2008 and SQL Server Express 2008. I've built the
    >beginnings of an ASP.NET 3.5 app that reads a connection string from the
    >configuration, in the usual way, and I can use LINQ-to-SQL against it
    >and output listings of data from the database to a page with no problem.
    >
    >But I've created a custom membership provider that uses this string to
    >create a data context for LINQ-to-SQL, and placed a Login control on a
    >page that uses this membership provider. This page opens fine when I run
    >it from Visual Studio, but when I enter some text into the login form
    >and submit it, the error message "Failed to generate a user instance of
    >SQL Server. Only an integrated connection can generate a user instance."
    >appears in the browser. Visual Studio, meanwhile, doesn't give me any
    >indication that there's a problem. The details under the error message
    >in the browser go on about the App_Data directory, but my App_Data
    >directory is empty and I haven't referred to it anywhere.
    >
    >Any ideas on the source of the trouble?


    Hi

    The error suggests that you don't have Integrated Security=True in the
    connection string, but I would expect that you would get that from
    visual studio if it was the case.If you are using a forms based
    authentication I would expect that you are trying to enter as username
    and password for the connection i.e. SQL Server authentication, in
    which case you can create a user instance.

    John
    John Bell, Mar 28, 2010
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page