locked
Mempership and SQL Server RRS feed

  • Question

  • User831030258 posted

     Hi all,

     I`m using Membership class to login and create new user..etc such as this code (Membership.ValidateUser(txt_UserName.Text, txt_Passwd.Text))

    but this works only on SQL database file wich attached in App_Data folder

    But now I`m using SQL Server 2005 and all my data will be on the server

    the question is: Is it possible to use the same code to work on SQL Server  2005 ? How to ?

    Thanks

    Saturday, December 6, 2008 7:15 AM

Answers

All replies

  • User541108374 posted

    Hi,

    please take a look at this article: Create Membership tables in another database than the standard aspnetdb.mdf.

    Grz, Kris.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, December 6, 2008 7:19 AM
  • User831030258 posted

     Thanks XIII for your reply

    I already imported all aspnetdb.mdf`s tables to my database and its ready to be used

    then I edited the connection string like this

     

        <connectionstrings>
            <add name="<span" class="st">"ConnectionString" connectionString="Data Source=(local);database = Mydatabase;Integrated Security=True;" providerName="System.Data.SqlClient"/>
        </add></connectionstrings>

     but I still get this error

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

     

    so plz tell me what to do to solve this problem

    Best Regards

     

    Saturday, December 6, 2008 7:37 AM
  • User541108374 posted

    Hi,

    first of all for the sqlmembership to work you need to name it LocalSqlServer as you need to override the default setting (also remove the name first, look into the formentioned article I provided).

    SQL Server does not allow remote connections

    Take a look here: http://search.live.com/results.aspx?q=SQL+Server+does+not+allow+remote+connections&go=&form=QBLH.

    Grz, Kris.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, December 6, 2008 7:46 AM
  • User831030258 posted

    Thanks for help it now working successfully.

    Saturday, December 6, 2008 8:44 AM