| | |
built in login and createuser wizard but for a remote SQL database? how to change?
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Mar 2007
Posts: 14
Reputation:
Solved Threads: 0
built in login and createuser wizard but for a remote SQL database? how to change?
0
#1 Apr 26th, 2007
I am trying to implement an example of the built in login and createuser wizard. the ony problem is, (and this may be really retarded of me) is that when i publish it out to a web server it doesn't work. Of course, it works perfect locally.
Does the aspnetdb.mdf that runs on my computer not run on the real server?
Ideally, I want this to run off a remote SQL database, but I am not sure how to set that up... I see in the help and online that I am aupposed to be able to slect another source to store this data on the "Provider" tab, but I don't see that optoin.
When I click the ASP.NET Configuration Tool all i can see on the page for my optoins are:
--------------------------------
Use this page to select a provider for each feature.
Membership Provider
AspNetSqlMembershipProvider -CHECKED
Role Provider
AspNetSqlRoleProvider -CHECKED
AspNetWindowsTokenRoleProvider
-------------------------------------
So, I'd like to know the answer to 2 questions:
1-Can the aspnetdb.mdf that runs on my computer run on the real server?
2-how can I convert this to use a remote SQL database, ie, I can't see where to set the datasource as I do in the drigeview, detailsview etc portions of the visual web devloper express program...
Thanks For Your Help!
Andrea
Does the aspnetdb.mdf that runs on my computer not run on the real server?
Ideally, I want this to run off a remote SQL database, but I am not sure how to set that up... I see in the help and online that I am aupposed to be able to slect another source to store this data on the "Provider" tab, but I don't see that optoin.
When I click the ASP.NET Configuration Tool all i can see on the page for my optoins are:
--------------------------------
Use this page to select a provider for each feature.
Membership Provider
AspNetSqlMembershipProvider -CHECKED
Role Provider
AspNetSqlRoleProvider -CHECKED
AspNetWindowsTokenRoleProvider
-------------------------------------
So, I'd like to know the answer to 2 questions:
1-Can the aspnetdb.mdf that runs on my computer run on the real server?
2-how can I convert this to use a remote SQL database, ie, I can't see where to set the datasource as I do in the drigeview, detailsview etc portions of the visual web devloper express program...
Thanks For Your Help!
Andrea
Re: built in login and createuser wizard but for a remote SQL database? how to change?
0
#2 Apr 26th, 2007
I think there's a way to attach the mdf file to Sql Server on the remote host during deployment or in the application config or something. I've never done it cos we run our own web-servers and db-servers. But I'll see what I can find out.
•
•
Join Date: Jan 2006
Posts: 275
Reputation:
Solved Threads: 11
Re: built in login and createuser wizard but for a remote SQL database? how to change?
0
#3 May 3rd, 2007
To use a remote SQL Server you need to add the settings to your web config. At the top you need to add the connection string
Then you need to change authentication mode to forms and add the providers.
Now when you go to the admin site you will see the new providers and test them
<connectionStrings> <add name="MyConnectionString" providerName="System.Data.SqlClient" connectionString="Data Source=servername;Initial Catalog=database;UID=username;pwd=password"/> </connectionStrings>
Then you need to change authentication mode to forms and add the providers.
<authentication mode="Forms"> <forms name="appname" loginUrl="login.aspx" protection="All" path="/" timeout="60"/> </authentication> <membership defaultProvider="MySqlLoginProvider"> <providers> <add name="MySqlLoginProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="MyConnectionString" applicationName="appname" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="3" passwordAttemptWindow="30" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0"/> </providers> </membership> <roleManager defaultProvider="MyRoleProvider" enabled="true" cacheRolesInCookie="true" cookieName=".ASPRoles" cookiePath="/" cookieTimeout="60" cookieSlidingExpiration="true" cookieProtection="All"> <providers> <add name="MyRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="MyConnectionString" applicationName="appname"/> </providers> </roleManager>
Now when you go to the admin site you will see the new providers and test them
•
•
Join Date: Mar 2008
Posts: 3
Reputation:
Solved Threads: 0
Re: built in login and createuser wizard but for a remote SQL database? how to change?
0
#4 Mar 5th, 2008
•
•
•
•
To use a remote SQL Server you need to add the settings to your web config. At the top you need to add the connection string
<connectionStrings> <add name="MyConnectionString" providerName="System.Data.SqlClient" connectionString="Data Source=servername;Initial Catalog=database;UID=username;pwd=password"/> </connectionStrings>
Then you need to change authentication mode to forms and add the providers.
<authentication mode="Forms"> <forms name="appname" loginUrl="login.aspx" protection="All" path="/" timeout="60"/> </authentication> <membership defaultProvider="MySqlLoginProvider"> <providers> <add name="MySqlLoginProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="MyConnectionString" applicationName="appname" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="3" passwordAttemptWindow="30" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0"/> </providers> </membership> <roleManager defaultProvider="MyRoleProvider" enabled="true" cacheRolesInCookie="true" cookieName=".ASPRoles" cookiePath="/" cookieTimeout="60" cookieSlidingExpiration="true" cookieProtection="All"> <providers> <add name="MyRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="MyConnectionString" applicationName="appname"/> </providers> </roleManager>
Now when you go to the admin site you will see the new providers and test them
ASP.NET Syntax (Toggle Plain Text)
System.Configuration.ConfigurationErrorsException: The 'system.web' start tag on line 16 does not match the end tag of 'authentication'. Line 57, position 9. (C:\WebSite1\web.config line 57) ---> System.Xml.XmlException: The 'system.web' start tag on line 16 does not match the end tag of 'authentication'. Line 57, position 9. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args) at System.Xml.XmlTextReaderImpl.ThrowTagMismatch(NodeData startTag) at System.Xml.XmlTextReaderImpl.ParseEndElement() at System.Xml.XmlTextReaderImpl.ParseElementContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlTextReader.Read() at System.Configuration.XmlUtil.CopySection() at System.Configuration.BaseConfigurationRecord.ScanSectionsRecursive(XmlUtil xmlUtil, String parentConfigKey, Boolean inLocation, String locationSubPath, OverrideModeSetting overrideMode, Boolean skipInChildApps) at System.Configuration.BaseConfigurationRecord.ScanSectionsRecursive(XmlUtil xmlUtil, String parentConfigKey, Boolean inLocation, String locationSubPath, OverrideModeSetting overrideMode, Boolean skipInChildApps) at System.Configuration.BaseConfigurationRecord.ScanSections(XmlUtil xmlUtil) at System.Configuration.BaseConfigurationRecord.InitConfigFromFile() --- End of inner exception stack trace --- at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal) at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors) at System.Configuration.Configuration..ctor(String locationSubPath, Type typeConfigHost, Object[] hostInitConfigurationParams) at System.Configuration.Internal.InternalConfigConfigurationFactory.System.Configuration.Internal.IInternalConfigConfigurationFactory.Create(Type typeConfigHost, Object[] hostInitConfigurationParams) at System.Web.Configuration.WebConfigurationHost.OpenConfiguration(WebLevel webLevel, ConfigurationFileMap fileMap, VirtualPath path, String site, String locationSubPath, String server, String userName, String password, IntPtr tokenHandle) at System.Web.Configuration.WebConfigurationManager.OpenWebConfigurationImpl(WebLevel webLevel, ConfigurationFileMap fileMap, String path, String site, String locationSubPath, String server, String userName, String password, IntPtr userToken) at System.Web.Configuration.WebConfigurationManager.OpenMappedWebConfiguration(WebConfigurationFileMap fileMap, String path) at System.Web.Administration.WebAdminPage.OpenWebConfiguration(String path, String appPhysPath, Boolean getWebConfigForSubDir) at System.Web.Administration.WebAdminPage.OpenWebConfiguration(String path, Boolean getWebConfigForSubDir) at System.Web.Administration.WebAdminPage.VerifyAppValid()
•
•
Join Date: Mar 2008
Posts: 1
Reputation:
Solved Threads: 0
Re: built in login and createuser wizard but for a remote SQL database? how to change?
0
#5 Mar 12th, 2008
![]() |
Similar Threads
- direct remote sql connection (Visual Basic 4 / 5 / 6)
- SQL Database loop (C#)
- Insert into sql database (ASP.NET)
- Process very slow - SQL Database (MS SQL)
- Help with Roles Stored in SQL database (ASP.NET)
- Snyc'n Local SQL database online (MS SQL)
Other Threads in the ASP.NET Forum
- Previous Thread: GridView Change Color to Column Values
- Next Thread: Cannot delete cookies
| Thread Tools | Search this Thread |
.net 2.0 activexcontrol advice ajax alltypeofvideos asp asp.net bc30451 bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn checkbox click commonfunctions compatible confirmationcodegeneration content contenttype courier css dataaccesslayer database datagridview datagridviewcheckbox datalist deadlock development dgv dropdownlist dropdownmenu dynamically edit expose fill flash flv formatdecimal forms formview gridview homeedition iframe iis javascript jquery listbox login menu microsoft mono mouse mssql multistepregistration news numerical objects opera order panelmasterpagebuttoncontrols radio ratings registration reportemail rotatepage save schoolproject search security serializesmo.table silverlight smartcard smoobjects software sql-server sqlserver2005 suse textbox tracking unauthorized validation vb.net video videos virtualdirectory vista visual-studio visualstudio web webapplications webarchitecture webdevelopemnt webprogramming webservice xml xsl youareanotmemberofthedebuggerusers






