I am trying to add membership to my site. i use visual web developer and the set controls. i.e. login etc. I also used the asp web config tool which is where my test users are. Everything works locally. but when i upload it and try to log on I get this error message:
Server Error in '/' Application.
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)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: 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)
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
In my site, when a user registers, I need to create rows in additional tables besides aspnet_Users. So, I need to be able to pass the generated userId guid to subsequent SqlCommands. I'm having a terrible time with this. What's the correct way to set up a SqlParameter so that it will accept a guid? I keep getting this error: "Conversion failed when converting from a character string to uniqueidentifier." I've tried creating the parameter both with and without a SqlDbType. cmd.Parameters.AddWithValue(paramName, guid); and SqlParameter p = new SqlParameter(paramName);p.SqlDbType = SqlDbType.Guid;cmd.Parameters.Add(p); and I get the same error either way. Driving me nuts! Any help appreciated.
Hi all, First ASP.NET project - please be gentle ! OK. Ready to add personalisation and membership. I have VS2005 Professional, including SQL Server 2005 developer, but I understand that VS2005 defaults to creating a local SQL Express file in the App_Data directory and that suits me just fine for now. Unfortunately I can't get VS to create it for me and the ASP.NET Configuration tool complains it can't connect to the database. First, some REALLY dumb questions to show how little I really know ...
if the application is using a SQL Express file, does the SQL Server 2005 process need to be started in order to access the local database file (or does it just get opened like an access database) does the Broswer process need to be started - this is all just running on my local machine when I finally publish this site on my hosted service I could do with understanding what will need to be done to get THAT database accessed ... maybe cross that bridge later I can go to the VS command prompt and run aspnet_regsql.exe in wizard mode. Going through the steps on that I could give it my SQL Server 2005 server name (after I start it) but that's not what I'm trying to do. I just want it to create and connect to a local file in the App_Data. machine.config shows ... <connectionStrings> <add name="LocalSqlServer" connectionString="data source=.SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" /> <!-- <add name="LocalSql2005" connectionString="Data Source=MICKSPCSSLMJ;Initial Catalog=aspnetdb;Integrated Security=True" providerName="System.Data.SqlClient" /> --> </connectionStrings> The commented connection string I used to temporarily prove that I could access SQL2005. It's no longer used and I've put the other references back to "LocalSqlServer" as below ... <membership> <providers> <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" /> </providers> </membership> <profile> <providers> <add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> </providers> </profile> <roleManager> <providers> <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <add name="AspNetWindowsTokenRoleProvider" applicationName="/" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> </providers> </roleManager>The profile provider is clearly pointing to "LocalSqlServer" which in turn points to : connectionString="data source=.SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" What am I missing please ?
I have a two problems. First is connecting to my sql server 2005 express with my sql account. Every time i try to configure data source to connect to my db on server using my windows auth. it works and when i try using my sql account i get error, User is not associated with a secure SQL Server connection. Second, how can i configure my application to store membership, roles, user data in a database on my server like /Servername/SQLEPRESS/mydbname and not to App_Data/ASPNETDB. Tnx in adv.
I recently moved my .NET project out to production, the server is Windows 2003 running SQL 2005. My developement server was a Windows XP running SQL 2005. Here is my issue. Under development I created a specific user to log in as, created a role and specified exactly what application specific stored procedures etc. that user was allowed access to. Everything worked fine. Backing that database up and restoring it to the new server, when I attempt to log in as the user (and yes I re-created the login, with the user, just as I did on the development server), I get this error... EXECUTE permission denied on object 'aspnet_CheckSchemaVersion', database 'MoldKit', schema 'dbo'. So I attempt to login as SA, and everything works... so I assign the db_owner role to my user and login, everything works... problem being they shouldn't be db_owner. And they're most definitely not assigned this role on development. I even went so far as to delete the database, and recreate it from scratch using the aspnet_regsql.exe and I get the same error. Anyone have any idea why this is happening, or the proper roles I need to assign so the user isn't a dbo, but can still call all the required aspnet procedures. Or could this be some other issue caused by 2003? I've seen this error in a lot of posts, but never once saw a definiative answer to what causes it and and what the fix is.
I have just recovered data from a hard drive crash. I installed a fresh copy of Windows Server 2003 with sp2. Have SQL Standard Running with sp2, and VS 2005 standard running sp1. I have several webs on this server, was able to get most up and running fine, but one web and database cannot make the connection after recovery. I had to reapply permissions and folder security to all webs, and change provided dbo privaledges to network_services. However I am still getting the following error: Server Error in '/bpe' Application.-------------------------------------------------------------------------------- The EXECUTE permission was denied on the object 'aspnet_CheckSchemaVersion', database 'Fitness1stDb', schema 'dbo'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: The EXECUTE permission was denied on the object 'aspnet_CheckSchemaVersion', database 'Fitness1stDb', schema 'dbo'. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [SqlException (0x80131904): The EXECUTE permission was denied on the object 'aspnet_CheckSchemaVersion', database 'Fitness1stDb', schema 'dbo'.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +857354 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734966 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +149 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +886 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +415 System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +135 System.Web.Util.SecUtility.CheckSchemaVersion(ProviderBase provider, SqlConnection connection, String[] features, String version, Int32& schemaVersionCheck) +367 System.Web.Security.SqlMembershipProvider.CheckSchemaVersion(SqlConnection connection) +85 System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +1121 System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105 System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42 System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +83 System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160 System.Web.UI.WebControls.Login.AttemptLogin() +105 System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35 System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
--------------------------------------------------------------------------------Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
Hello, I am using the Membership application for my project. In the database (MS SQL 2005) the program created alot of SPs for the Membership, Roles, Profiles .... Is there a function to return a list of users that are online? There is this function aspnet_Membership_GetNumberOfUsersOnline and aspnet_Membership_GetAllUsers. What i want is a Table with the usernames of all the users that are online in my application. No page index, just a big table with all the online users. I need to get all the usernames for another SP that i just build. Any ideas?
Hello, I have an ASP.NET Membership Database that exists on a remote server. I have been using this database as I developed my ASP.NET 2.0 application locally. When I attempted to promote my ASP.NET 2.0 application to production, I am unable to connect to that same remote database. Oddly, there is another database on that same remote server that I can access from my ASP.NET application in both development and production. Can anyone explain to me what could cause this? Thank you!
I need to create a membership database that includes levels and premiums for each level. Can anyone offer any examples of how this should be done? What tables I would need and how they would be related to each other?
Almost have my custom membershipprovider finsihed, but have ran into a small snag.Scenario:: 2 methods. CreateUser(blah blah) and ValidateUserName(string username). CreateUserWizard control calls CreateUser(blah blah) which in the start of the method calls ValidateUserName(string username). ValidateUserName runs a stored procedure on SQL 2k to check and see if user exists in the db. Returns a bool true or false. If true, then everything works correctly and returns a message displaying that the user exists, please enter a different name.Now the problem. If it returns false, meaning that the username doesnt exist and is available to use, it calls a stored procedure to create the record in the users db. This is where the problem lies. It does NOTHING but sit there waiting. But it never seems to time out. If I comment out the validating. It will add a record successfully.Im wondering if it has something to do with calling 2 stored procedures consecutivly????::CODE TO FOLLOW::
on the login properties i see a third option under security access - Grant access - Deny access - Through group membership
what is the third one? I tried to change it to grant access but it doesn't let me. Neither can I uncheked a database box on 'Database Access tab'. It says DB owner cannot be dropped.
I am attempting to follow the instructions: Walkthrough: Creating a Web Site with Membership and User Login (Visual Studio) When I attempt to create a membership user with the ASP.NET Configuration wizard nothing happens - it attempts to launch my browser and if I am not connected to the intenet it insists on connecting. If I am connected then nothing happens - it is as if I clicked on air. A wizard is supposed to launch so that I can set up users. Any help would be appreciated - I am really trying to get to creating an application that authenticates users for admitance to a restricted area in a website. Thanks!
Decided to try testing SqlCacheDependency and got the following.... thoughts???After using the following code...void Application_Start(object sender, EventArgs e) { System.Data.SqlClient.SqlDependency.Start (ConfigurationManager.ConnectionStrings["testConnectionString"].ConnectionString); }//-------------------------------- ... then more code SqlCommand sqlCommand = new SqlCommand("select ApplicationName from dbo.aspnet_Applications", sqlConnection); SqlCacheDependency sqlCacheDependency = new SqlCacheDependency(sqlCommand);//-------------------------------- ... then more codeMembershipUser membershipUser = Membership.CreateUser(defaultUserNameTextbox.Text, defaultUserPasswordTextbox.Text); if (membershipUser != null) {//----------------------------- ... more codethe above code no longer works giving the below exception : using a plain database generated using the following statement
I have a site with roles/membership working fine on my local machine, but I am having serious trouble deploying it to a shared host. My hosting provides a sql 2000 database, but the user created for it that I use is not dbo. I am errors when I try to access my site such as Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'The procedure was created under my user, so it's there, but it's full name ia myusername.aspnet_CheckSchemaVersionHow can I tell the asp.net membership/role provider to use my username instead of dbo when it looks for objects? Thanks
Hi, I am running a project that has a custom membership flow. I need to use the local SQL Express Membership instead. In orderer to achieve this, I have added the following lines in my web.config: in the membership section: <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" passwordAttemptWindow="10" passwordStrengthRegularExpression="" /> in the connectionStrings section:<add name="LocalSqlServer" connectionString="data source=.SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
Problem : When I am opening ASP.NET Configuration > Security I have the following error message: 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: Object reference not set to an instance of an object.
I've started developing an ASP.net 2.0 app with VWD Express.The default membership provider db of SQL Server 5005 Express is not installed on my host servers. So my workaround has been to use a Full blown SQL Server 2005 DB as a custom membership provider declared in web.config. This works fine on the production server. However, when i try to login from my development app I get Exception # 40 can't connect to SQL server membership provider.. Moreover, my app configuration confirms there is problems connecting to this server in my development environment. How can I solve this and bring my development app up & running again? many thanks
I recently transfered my web app to my Windows 2003 server and am having difficulty getting the system to allow me to login.I am using MS SQL Express 2005 and the SQL Express Manager.I have a user/password setup with SQL Authentication. It appears that I am connecting okay, but I am unable to login to the site. I have tried three different accounts with no luck. I know I am using the correct passwords.What permissions do I have to grant my database user to allow me to login to my site?As I am new to SQL Express and the manager, a more specific reply would be very helpful.Thank you,Joshua Foulk
I have a VS 2005 web site on my local development server (IIS running on windows XP). It uses the standard visual web developer express database for the membership provider. When I upload to my production server (Windows Server 2003) the membership db becomes read only. I've checked all the role & user permissions as well as my folder access rules. How can I get the db to behave properly on my production server? Many thanks in advance
I know this may sound like a silly question but, my project currently uses two databases, the aspnet membership db and our application db. What I'm wanting to know is if there is a way to combine them without lossing any current functionality from either one? Also what if any gotchas there might be?
I've set up the membership and authentication tables/stored procedures on an SQL2005 Express database. I'm now trying to get the login on my forms to work. I set up two 'members' through the Web Site Administration Tool and everything seems to work fine as far as logging in is concerned. However, I need to retrieve some information from the membership tables through the codebehind but I've discovered that the data created by the WSAT wasn't stored in my database but in the ASPNETDB.MDF file in my application's Bin folder. How can I ensure that the data created by the WSAT is stored in the correct database? What have I missed?
Hi all, I have a question about generating membership numbers on the fly when someone registers to my website.
Rather than using the auto increment field as a membership number, I would rather keep it as just as the ID for the record and I would like to have a seperate membership number that looks something similar to this...
SR357324J
This will then stay with them for the lifetime of their membership and be on their printed loyalty card.
My questions are... 1) Is there a 'good practice' for membership number format and generation?
2) If this was used as a unique field, is there a degradation in performance when looking up records due to it being alphanumeric.
I may be well off base here, however these are my thoughts so far and your opinion/help is greatly appreciated.
Hello,I'm programming asp.net 2.0 with a mySql database.Now I want to implement membership-features.I consider converting mySql to SQL server 2000 because then I don't have to build a custom membershipprovider.my question is: does membership work as good on sqlserver2000 as it does on sqlserver2005? (my host doesn't support sqlserver2005 (yet).another question: can I expect problems converting the database from mysql to sqlserver2000?
I created a membership database on my local computer. DB is SQL Server 2005. I created create sripts for that database and created this database in a SQL Server 2000 instance on another box.As soon as I changed my web.config file to point to the new database, I got this error below. What is causing it?The 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1'. However, the current database schema is not compatible with this version. You may need to either install a compatible schema with aspnet_regsql.exe (available in the framework installation directory), or upgrade the provider to a newer version.Do I have to create a local Membership database in a SQL 2000 instance, script it out and then create in the other box?Thanks
I am convinced this code should work for SQL Server 2000 but is does not return the correct set. Please share any input, I am stuck.:confused:
A list is set named 'oklist', in this example a state list: (CA, AR, AK)
SELECT Subscribers.SubscriberID, Subscribers.EMail FROM (Subscribers INNER JOIN SubscriberAddress ON (Subscribers.SubscriberID = SubscriberAddress.SubscriberID)) WHERE SubscriberAddress.state IN ('#oklist#')
Hi, Permissions were granted to sql users based on their groups in the domain - that is groups were added as sql users rather than the login names. Is there any way I can determine the group a user belongs on login to sql server?. I need to develop an interface that enables relevant menu to relevant groups.
Hello all,I need help with sql server which i was wondering if someone can shedsome light on my problemThe problem:Hello all,I need help with sql server which i was wondering if someone can shedsome light on my problemThe problem:i am using .net 2.0 membership provider interface to provide amembership in my website...now i also am using the sql server 2005 forthe backbone of the site..now when a new user is created theirinformation is saved into asp_ membership and their userid isautomactially saved into another table called asp_users...now these aredefaults by membership provider...what i would like to do is to createanother table which i have called "Rank" and i would a column in this"rank" table that would keep the user ids, now i have noticed that theasp_user.UserId has a releationship with asp_Membership.userId so when anew user is created asp_user.Userid automactially gets updated..i havecreated a colum called Rank.UserId which has a relationship withasp_users.userid and asp_membershi.Userid but it doesnot get updatedautomatically when a new user is created...what can i do so i can havethis table "Rank" also gets updated automactially as soon a a new useris created or a user has been deleted...just like asp_users gets updated...thanks in advance---Best RegardsAmir---Best RegardsAmir*** Sent via Developersdex http://www.developersdex.com ***
I created 2nd copy of my entire asp.net website folder. I tried opening that 2nd folder in VWD and ran it. when i was logging into the membership it wont authenticate anymore. I opened the database to double-check the users and found the exactly the same database (as I expected) that I have on the 1st copy website folder. All the users are listed there. I opened the "ASP.NET web Application Administration" and it says I have no users nor any role and that is really impossible coz I can see the aspnet_Membership table having all the users and other info. If i run the 1st copy website folder, no problem at all.
Why is that? Can someone explain this to me pls? Im confused. im a student. big thanks!
I've been coding for a few weeks now, building an ASP.NET application. ran the aspnet_regsql.exe wizard and it created my table and procedures correctly within the live SQL 2005 server being run by my host (ASPNIX.COM). I've been able to run my app just fine locally saving to my remote SQL server. However, now that I've moved my code onto my hosted server, my app stopped working. You would think this would "jus work" since I've been using the same SQL server throughout...BUT NOoooo! I've scoured the net trying to find any hint about what might be happening. The ONLY thing I've been able to find is a story in the May issue of asp.netPRO that says "Once the scripts have been executed, grant the user account used to access the database from the Web application Execute permissions on all the new stored procedures and Selection permissions on the views that were created"This may be my problem, but I haven't figured out how to accomplish this. Within the SQl Server Management Studio Express, I can pull up the properties of each stored procedure and place a check next to my "USER" account. However it does not appear to be saved.My symptoms at this point are:It will not log me in under accounts I'd already created.