Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

VS2008 using SQL2k as membership provider?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rockdale - 09 Mar 2008 00:45 GMT
I have spent half day on this issue already, do not know what's wrong.
Please help.

I am trying to use SQL2k instead SQM2k5 express as my membership
provider.

but when I try to config it using asp.net configuration tool, I got
the following error:

There is a problem with your selected data store. This can be caused
by an invalid server name or credentials, or by insufficient
permission. It can also be caused by the role manager feature not
being enabled. Click the button below to be redirected to a page where
you can choose a new data store.

The following message may help in diagnosing the problem: 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: Named Pipes Provider, error: 40 - Could not
open a connection to SQL Server).

The error message sounds strange, why they use named pipe to connect?
Also, How VS2008 know its sql2k or sql2k5 since they use the same
System. Data.SqlClient??

----------------------

My config file looks like

 <connectionStrings>
   <remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=.
\SQLExpress;Integrated Security=True;User
Instance=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf"
providerName="System.Data.SqlClient"/>
   <add name="MSSql2k" connectionString="Data
Source=local;database=mydb;uid=**;pwd=**;"
providerName="System.Data.SqlClient"/>
 </connectionStrings>

<membership defaultProvider="MySqlMembershipProvider">
     <providers>
       <add connectionStringName="MSSql2k"
enablePasswordRetrieval="false"
         enablePasswordReset="true" requiresQuestionAndAnswer="true"
         applicationName="MyAppl" requiresUniqueEmail="true"
passwordFormat="Hashed"
         maxInvalidPasswordAttempts="6" minRequiredPasswordLength="2"
         minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10"
         passwordStrengthRegularExpression=""
name="MySqlMembershipProvider"
         type="System.Web.Security.SqlMembershipProvider" />
     </providers>
   </membership>

I used aspnet_sqlreg.exe to succesfully register my sql2k database,
and in VS2008 server explorer I can see all the tables views and SPs.

If I change to use LocalSqlServer, then it works fine....

Thanks in advance

-rockdale
Peter Bromberg [C# MVP] - 09 Mar 2008 01:03 GMT
Take another look at your connection string. It specified SQLEXPRESS. You
just said you are using SQL 2000. A SQL 2000 connection string would look
something like:
server=(local);database=DatabaseName;uid=userName;pwd=password
Cheers.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net

> I have spent half day on this issue already, do not know what's wrong.
> Please help.
[quoted text clipped - 61 lines]
>
>  -rockdale
rockdale - 09 Mar 2008 04:27 GMT
I double checked my connection string:

it works on
<add name="LocalSqlServer" connectionString="Data
Source=myComputerName;database=myDB;uid=**;pwd=**;"
providerName="System.Data.SqlClient"/>
or
<add name="LocalSqlServer"
connectionString="Server=(local);database=sunodeuo;uid=sa;pwd=purvis;"
providerName="System.Data.SqlClient"/>

I forgot the "( )" around "local".

Now using LocalSqlServer works, as Scootgu's blog, we can simplly
change the LocalSqlServer to point to the sql2k or sql2k5, but I still
want to try MSSql2k connectionString and mySqlMembershipProvider, as
following.

-------------------------------------------------------------------------------
<roleManager enabled="true"  defaultProvider="myRoleProvider">
     <providers>
       <clear/>
       <add connectionStringName="MSSql2k"
            applicationName="myAppl"
            name="myRoleProvider"
            type="System.Web.Security.SqlRoleProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
     </providers>
   </roleManager>
   <membership defaultProvider="mySqlMembershipProvider">
     <providers>
       <clear/>
       <add connectionStringName="MSSql2k"
enablePasswordRetrieval="false"
         enablePasswordReset="true" requiresQuestionAndAnswer="true"
         applicationName="myAppl" requiresUniqueEmail="true"
passwordFormat="Hashed"
         maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7"
         minRequiredNonalphanumericCharacters="1"
passwordAttemptWindow="10"
         passwordStrengthRegularExpression=""
name="AspNetSqlMembershipProvider"
         type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

<add connectionStringName="MSSql2k" applicationName="myAppl"
         enablePasswordRetrieval="true" enablePasswordReset="true"
requiresQuestionAndAnswer="true"
         requiresUniqueEmail="true" passwordFormat="Encrypted"
maxInvalidPasswordAttempts="5"
         passwordAttemptWindow="10" minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="0"
         name="mySqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
     </providers>
   </membership>

------------------

But when I choose Select a different provider for each feature
(advanced)

Use this page to select a provider for each feature.

Membership Provider
AspNetSqlMembershipProvider     Test
mySqlMembershipProvider     Test

Role Provider
myRoleProvider       (HERE IT DOES NOT HAVE Test hyperlink)

is the roleProvider working even though there is no test hyperlink
since the Membership Provider is working.?
Again thanks

On Mar 8, 8:03 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.NoSpamMaam.com> wrote:
> Take another look at your connection string. It specified SQLEXPRESS. You
> just said you are using SQL 2000. A SQL 2000 connection string would look
[quoted text clipped - 71 lines]
>
> >  -rockdale
sloan - 09 Mar 2008 02:35 GMT
Check

http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx
and

http://sholliday.spaces.live.com/blog/cns!A68482B9628A842A!160.entry

>I have spent half day on this issue already, do not know what's wrong.
> Please help.
[quoted text clipped - 61 lines]
>
> -rockdale

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.