Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 9th, 2006, 07:43 PM
Authorized User
Points: 157, Level: 3
Points: 157, Level: 3 Points: 157, Level: 3 Points: 157, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2006
Location: , , .
Posts: 21
Thanks: 0
Thanked 1 Time in 1 Post
Default Configuring SS 2005, vStudio 2005 only Environmnt

Would anyone clarify the step-by-step installation and configuration for a SS 2005 Std Ed and Visual Studio 2005 only environment on Win XP?! -- NO Express products installed!

In particualr, I'm having problem getting the App Services aspnetdb.mdf database to generate under the app_data folder. Using the aspnet_regsql.exe completes successfully but the database is not to be found.

I have made the following changes to the machine.config connectionString:

".\SQLEXPRESS" ===> "YLW4WSDVLPR2" <-- my machine/SS name
"User Instance=True" ==> (removed)

. . . but to no avail.

Thanks, mk
  #2 (permalink)  
Old February 10th, 2006, 04:30 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

Take a look at this blog post: http://weblogs.asp.net/scottgu/archi...25/423703.aspx

The trick is to use the ASPNET_REGSQL tool to prepare your SQL Server database for the providers. Once the database is done, you need to reconfigure the config file so the app knows what database to use.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #3 (permalink)  
Old February 10th, 2006, 05:57 PM
Authorized User
Points: 157, Level: 3
Points: 157, Level: 3 Points: 157, Level: 3 Points: 157, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2006
Location: , , .
Posts: 21
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thank you very much for your reply, Imar.

I have to admit, I read the blog prior to posting. However, I have found that there was some magic involved in some of the steps given by scott, especially with step (1) and the execution of the app services utility. I tried them and they failed to work for me.

Step 1: Where do you get that connection string, and once you do get it, where do you place it?

As far as using the aspnet_regsql.exe utility, as I already mentioned in my posting, I tried it -- and could find no database generated -- though the utility completed successfully. The database was not under the app_data folder or elsewhere.

Come to think of it, how does the utility find the app_data folder in which to generate the database?? My application folder is on a second drive and very deep inside a subfolder.

Bottom line, apparently scott's procedure needs some correction and additions -- because it does NOT work as stated.

Any additional help will be appreciated.

Thanks.
  #4 (permalink)  
Old February 10th, 2006, 08:16 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

You need to be aware of the differences between the "normal version" of SQL Server, and the Express edition.

The Express edition is used by default to autogenerate a database by the .NET Framework (as instructed with the default LocalSqlServer (or whatever it's called exactly) connection string in the machine's root config file.)

If you want to use SQL Server, you should not try to use SQL Express and have the attached database appear in the aspnet_regsql tool's Databases list. I have tried that a couple of times, but it never quite worked. I think this is caused by the UserMode property that also detaches the database again. Also, there is a fair chance that under SQL 2005 Standard edition, your database is stored *outside* the App_Data folder, and stored somewhere under the Data folder of SQL Server, or another location you choose.

Anyway, here's what you should do (and what has worked for me many times).

1. Run the aspnet_regsql tool.
2. Point to your SQL Server installation (either 2000, or 2005, don't use Express)
3. Have it configure the database. Afterwards, you'll see the new tables, procedures, views and so on
4. Add a connection string to your web.config. This is a normal SQL Server connection string. E.g.:

<add name="YourConnectionString" connectionString="server=YourServer;Initial
Catalog=YourDatabase;Integrated Security=true;"/>

5. Configure the providers. The following snippet shows the code for the Membership and Role providers:

<membership>
  <providers>
    <clear/>
      <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="YourConnectionString" enablePasswordRetrieval="False" enablePasswordReset="True" requiresQuestionAndAnswer="False" applicationName="/" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" passwordAttemptWindow="10" passwordStrengthRegularExpression="" minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0"/>
      </providers>
    </membership>
    <roleManager defaultProvider="SqlProvider" enabled="true" cacheRolesInCookie="true" cookieName=".ASPROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All">
      <providers>
        <add name="SqlProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="YourConnectionString"/>
      </providers>
    </roleManager>

The trick here is to either create a brand new provider (as demo-ed here with the RoleManager provider code above). In that case you need the defaultProvider attribute to have it point to your provider settings.

Alternatively, reuse the *name* of an existing. In that case, you'll need to <remove /> or <clear /> the old providers, as you can see in the config for the Membership provider.

Either way, you use the connectionStringName attribute to point to the connection string you created in step 4.

So, the steps explained in the Blog do work as advertised. You just misunderstood the instructions. The seemingly simple step 1 may actually mean creating a database through the Enterprise Manager or the new SQL Server 2005 studio under a SQL Server instance, and then create a connection string to the instance (using examples from ConnectionStrings.com). Then you'll need to know the name of your database server, instance and database to point to the right database in the regsql tool.
I guess Scott assumed his readers knew how to do this but I agree he could have provided more details.

Does this help?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: English Summer Rain by Placebo (Track 2 from the album: Sleeping with Ghosts) What's This?
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Configuring SQL Server 2005?? kyllle ASP.NET 3.5 Basics 6 November 20th, 2008 10:46 AM
reg conn to sql server 2005 from vb.net 2005.. veda SQL Server 2005 2 July 1st, 2008 12:16 AM
Migrating 2005 AJAX-Enabled Web Site to 2005 SP1 jrblack10 ASP.NET 2.0 Professional 0 July 25th, 2007 02:16 PM
Are VS 2005 Express Products real VS 2005? cJeffreywang ASP.NET 1.0 and 1.1 Professional 3 March 30th, 2007 06:51 AM
VWD Express 2005 and VS 2005 - Help not working dmlocke C# 2005 0 March 21st, 2007 04:19 PM



All times are GMT -4. The time now is 09:52 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.