I'm using one application but have multiple providers in my web.config for memberships, roles and profiles to allow my application to be used by different groups of users who need to connect to different databases.
This means I'm having to change the membership, role and profile providers on-the-fly in my code-behind files. So far I've taken care of the membership and roles a bit like this:
However, I'm having trouble finding out how to do the same sort of thing for Profiles. I've looked at ProfileProvider and ProfileManager but I can't work it out how to access my the profile property that I've created in my web.config file called "ScreenSize". Normally you would just write Profile.ScreenSize to read or write to the property.
I have an issue where I am running out of database space on my hosting provider. As it turns out, the aspnetdb database is more than 6x our application database. We are using anonymous profiles and there are 21 fields stored in each user profile.
Upon analysis, most of this data is not required to be stored - it is simply wasting space. The part that is wasting the most space (5 binary objects) are not even used by any of the public users. I would like to remove these binary objects from all of the user's profiles without deleting the profiles, but I can't seem to find any documentation on how to do this.
I can remove the fields, which will take care of users going forward, but I need to retroactively delete these fields from the aspnetdb database to free up space. Since each user manages their own profiles, I am unsure how to create an automated procedure to delete these fields out each anonymous user's profile.
I've been experimenting with the ASP.NET profile system and I like how easy it is to add data to the profile programmatically and how to access it again, all in a single line.
However, I've see the input that it sticks in the database and I'm not too keen on it.
I'd really like to create my own separate tables, so everything is nice and logical and easy to access, but I'd still like to be able to access this "profile" data as easily as I could with the ASP.Net profile system.
Should I create some kind of class in a separate class file that does all the hard work, then I can access the information from intellisense?
I'm still trying to learn how all of this works, and I apologize if this is a simple fix, but I'm getting frustrated and I could use some help.
I found an XML profile provider that I'm trying to use, and when I set it up, it works fine on my local machine. However when I upload it to the server, I get an error and I don't really know what it means:
Server Error in '/' Application.
Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
I am trying to create a custom profile provider using multiple sql tables.1. I currently have 3 groups in my profiles (Customer, Employee, Applicant)2. Each group has separate tables for data. Do I need to write one (profile provider) for each group3. As new users are created, do I use the profile provider to store the info, or can I just write the info to the tables, then use the profile select to read and use?4. Anyone have any articles, and tutorials on creating a Custom Profile Provider using Tables that shows how to insert and update into each table?
I had to add the <remove name="MySqlProfileProvider"/>as it error with "the entry MySqlProfileProvider has already been made."The problem now is that it will only hold the data the first time I log in and create the account. Everything run find until you close the browser and try to log in the next time. Then the pages that use the profile properties tells me that there is no profile data for the same fields like there name for this user.It was there the first time and save it but the 2nd login it gone. Seems to me that the remove actually removes the data even when you save itI got it to work on the local server by setting MySqlProfileProvider up in using IIS managment tools. My local now rund fine. However my service provider will not make the manual entry for me.
I created a table named Thread to store logged-on users' comments. It has CommentId, Topic, Comment, CreatedTime and UserId columns. I made CommentId as the primary key and UserId as the foreign key to the UnserId in the Membership table aspnet_Users.But when I insert those data into table Thread, I get an error "Cannot insert the value NULL into column 'UserId', table 'ASPNETDB.dbo.Thread'; column does not allow nulls. INSERT fails.The statement has been terminated." I have tried different ways to resolve this, but could not make the UserId in the table Thread match the UserId in table aspnet_Users. Yesterday, I found the Table Profile Provider Samples created by Hao Kung at http://www.asp.net/downloads/sandbox/table-profile-provider-samples. It should be be able to solve my problem. But the code was written in C#. Is there anybody who knows a VB version of this code, or a better way to solve my problem?
I had to restructure my database so I could synch the data between the Web and local version of my application, which I had carelessly let run amok. I finally get all the records and schema into one database but now that I've done that, my Profile system isn't working anymore. I noticed that the relationships between aspnet_Users and _Membership (and my "profile additional items table") don't exist anymore. I ran the aspnet_regsql.exe utility and registered the DB, and I'm surprised that the registration didn't re-establish the foreign key relationships, etc.
Anyway, if someone can give me pointers on how to restore these relationships or direct me to a source that explains it (i.e., what the foreign keys should be named, if there are any other aspnet_ tables that need to be linked together), I'm pretty sure this would take care of my problem. And I just noticed that nothing is in the aspnet_Profile table. Should I start all over with a new database or is this one salvageable?
i am building a web application and i want to access a textbox which is on the index page from the login page. basically what i did is this. i programmatically created my registration form for new users and also login for registered users, now i want to display on the index page the name of the logged on user on the index as the page loads.
I developed a site for a client a couple of years ago. It uses the the standard ASP.NET Membership, authentication, etc. I just added the profile section with (2) fields: CustID AgntID. Now whenever I load the page with any Profile code in it I receive this error: Violation of UNIQUE KEY constraint 'IX_aspnet_Users'. Cannot insert duplicate key in object 'dbo.aspnet_Users'. The INSERT statement conflicted with the FOREIGN KEY constraint "FK__aspnet_Pr__UserI__3CA9F2BB". The conflict occurred in database "broo001", table "dbo.aspnet_Users", column 'UserId'. The statement has been terminated. The statement has been terminated. 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: Violation of UNIQUE KEY constraint 'IX_aspnet_Users'. Cannot insert duplicate key in object 'dbo.aspnet_Users'. The INSERT statement conflicted with the FOREIGN KEY constraint "FK__aspnet_Pr__UserI__3CA9F2BB". The conflict occurred in database "broo001", table "dbo.aspnet_Users", column 'UserId'. The statement has been terminated. The statement has been terminated. Source Error:
I am trying to build my own custom Membership Provider in an MVC 3 Web Application using C#.
Here is my code:
As you can see, I am just starting with it, and yet I've encountered problems. According to this tutorial when I right click on MembershipProvider, I should get the option to [ Implement Abstract Class ], but I don't get that ! I am using Visual Studio 2010.
I have a custom role provider class that is currently being used by a web application. We are now in the process of migrating several windows applications from VB6 to VB.Net. From preliminary research, I understand that I can use the custom role provider in win forms as well and came across Client Application Services. I understand how the Client Application Services is setup, but can't seem to find how the custom role provider code will be shared between the web apps and the windows apps.
I have a small windows forms application that uses the membership provider that is defined in my app.config file. I want to get rid of my app.config file and initialize the membership provider completely from code. The reason behind this is because I want to be able to dynamically connect to different databases containing asp.net user tables and I want the user to be able to enter the desired database information into a text box at run time. Is this possible or is it required that I have an app.config file?
I am trying to create my own profile provider based upon the tables I have made for my website, I have watched the video and read several articles on creating one, but none of them goes very indepth when you have several tables and groups to profile from. First: I have three groups
1. Employees 2. Customers 3. Applicants
PROBLEM: Video and tutorials don't show how to integrate groups into your profile. Based upon the UserId, I want to load only Table ID's into the profile. IE for a customer it would be
CustomerID from [customer_data] LocationID from [customer_location] ContactID from [customer_contacts]......................
I have a website that needs to store two sets of user data into separate data stores. The first set of data is used by the SiteCore CMS and holds information about the user. The second set of data is used by a personalisation application that stores its own user data. The reason they aren't stored together in the same profile object is because the personalisation application is used across multiple websites that do not all use SiteCore.
I am able to create multiple Profile Providers - I currently have one from SiteCore and a custom provider that I have written and these both work in isolation. The problem exists when you try to configure both in the same web.config file. It seems you can only specify a single Profile object in the web.config file, rather than one for each provider. This means that regardless of which provider is being used the .Net framework sends through the profile object that is specified in the "inherits" parameter in the profile section of the web.config file.
My questions are - Is it possible to specify a different Profile object for each Profile Provider? If so, how and where is this specified?
I should point out that there is no duplication of data in the two data sets, they are mutually exclusive (excluding email address). The SiteCore data is used solely for this website, but we have company wide profile data that spans across all of our applications, hence the need for a separate second profile object.
I am trying to use: [URL] I have downloaded the converted to VB files and inserted them in my app_code folder. I created the SQL table and ran both SQL stored procedures Now for the web.config, I already have a connection to my database for the aspnet memberships since I have it on my own database, so I used that for the connection and I did this:
But I get run time errors when I try to set a profile. The error I get is in the SqlTableProfileProvider.vb and it says "Incorrect syntax near ','." Which is really not enough information but that is all what it gives me
I created the Table Profile Provider with the VB.NET and it works perfectly but I have one issue with it.. My Table (UserProfile) can't be linked with any other tables because the UserID on userprofile is different than any other table yet when I do profile.firstname on the vb code it works perfectly. Say for example I have a username called john If I do select * from aspnet_users where username = 'john' The results would come to 2 rows, 1 which has a userid and applicationid that is used on ALL the tables in my database EXCEPT for userprofile The second one would have a applicationid and userid that is only use on my userprofile table.
Compared to the use of session variables or query string variables, I'm convinced that profile variables are the slick and easy way to go.
I have a profile provider that's been working great but now I have another page on which I'd like to use more profile variables, which would be based on another table. Is there any way to add another table to the profile provider? I tried creating an additional provider and found out very quickly that only one such section in web.config is allowed. I then attempted to add a new section in the AddName section under Providers but when I tried to use the profile variables in the page, I received an error message that they weren't in the table (referring to the table in the first provider).