Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics 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 Display Modes
  #1 (permalink)  
Old January 26th, 2009, 05:15 AM
Authorized User
 
Join Date: Jan 2009
Posts: 25
Thanks: 3
Thanked 1 Time in 1 Post
Default Login Controls

This may be stupid, but I can not figure it out.

I am using visual web developer. On my local version, I am able to use the web administration and create the aspnetdb to create users, login, etc. When I upload this, I needed to migrate the db to a new location and I can not seem to figure out how I redirect everything from the app data folder into the new mssql db. I have looked all through the code but can not seem to find out where I point my user controls to this new db. Any help would be greatly appreciated.
  #2 (permalink)  
Old January 26th, 2009, 09:37 AM
Lee Dumond's Avatar
Wrox Author
Points: 4,942, Level: 29
Points: 4,942, Level: 29 Points: 4,942, Level: 29 Points: 4,942, Level: 29
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2008
Location: Decatur, IL, USA.
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

All you really need to do is modify the connection string in web.config to point to the new location.
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
  #3 (permalink)  
Old January 26th, 2009, 10:32 AM
Authorized User
 
Join Date: Jan 2009
Posts: 25
Thanks: 3
Thanked 1 Time in 1 Post
Default I have the connection string

Thanks Lee. I have added the new connection string. My problem is I do not find any of the old connection string used to point the default login controls to the aspnetdb file. I am not sure if this was hidden somewhere in the code, but I can not tell where to point from. When using the standard 'web site administration' tool in VWD, this is all set up for you, and I don't seem to find how it is pointing to the add data folder.
  #4 (permalink)  
Old January 26th, 2009, 11:02 AM
Lee Dumond's Avatar
Wrox Author
Points: 4,942, Level: 29
Points: 4,942, Level: 29 Points: 4,942, Level: 29 Points: 4,942, Level: 29
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2008
Location: Decatur, IL, USA.
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

When you create a new site using the RAD tools as you have, it is automatically configured to use a connection string called "LocalSqlServer", which is located in machine.config.

To "override" that string, you can just "remove" the reference to the default LocalSqlServer connection string, and create a new one also called LocalSqlServer. That way, you won't have to alter any of the providers to use a new name.

Essentially, it would go like this:

Code:
<connectionStrings>
      <remove name="LocalSqlServer" />
      <add name "LocalSqlServer" 
           connectionString="your_connection_string_goes_here"
           providerName="System.Data.SqlClient" />
 </connectionStrings>
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
The Following User Says Thank You to Lee Dumond For This Useful Post:
mashype (January 31st, 2009)
  #5 (permalink)  
Old January 26th, 2009, 02:07 PM
Authorized User
 
Join Date: Jan 2009
Posts: 25
Thanks: 3
Thanked 1 Time in 1 Post
Smile Lee Rocks!

Thanks so much Lee! I have been fiddling with this forever and got nowhere. I am not quite done with it, but I see now that the login controls are connecting to the sql db. SOOOOOO much appreciated.
The Following User Says Thank You to mashype For This Useful Post:
Lee Dumond (January 26th, 2009)
 


Thread Tools
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
Cannot implicitly convert type 'Login' to 'System.Web.UI.WebControls.Login' fh84 BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 1 January 23rd, 2009 10:17 AM
Which SMTP server for login and other controls? tobe ASP.NET 2.0 Basics 0 November 30th, 2007 06:02 PM
Login Controls and Recover Password ~Bean~ ASP.NET 2.0 Professional 12 November 15th, 2006 02:13 PM
Login controls not using SQL server drb2k2 BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 March 5th, 2006 05:25 PM



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


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