webmatrix login information starter site (ASP.net) - asp.net

I just created a new Starter site on webmatrix using ASP.net, with the built in template.
I am wondering where the site stores all the password information? I understand WebSecurity is a built-in model, but I want to know where all these object information are being stored. The only columns in the user database table are "email" and "id".

Don't you have tables named 'webpages_...'? I think webpages_Membership is the one you are looking for.

#cesarse is correct about the table webPages_Membership. Take a look in your web.config file and look for the connection string, which will let you know which database your data is being saved in.

Related

Where exactly does Membership.CreateUser Method add the new user to?

So I created my first ASP.NET MVC 3 internet application which comes with the built in functionality of registering/logging in.
I tried to explore where exactly is the database the application interacts with.In the corresponding controller/action method I see a call to Membership.CreateUser with these parameters.To which MSDN link says it adds these values to the data store.My question is to which table of what database it adds these values?(so that I can see the updates)
Using default setting, your data is saved in in its default database ASPNETDB.MDF. Click Show all files in the Solution explorer then click App_Data. You should see ASPNETDB.MDF. Double click it then a database will appear to you in the Server Expolorer. On the ASPNETDB.MDF click Tables and find aspnet_Users.
Hope this helps. :)
Assuming all the above is true (haven't change the default setup, connection string etc.) then look for tables called aspnet_users, aspnet_membership and a few others prefixed with aspnet_ . that's where to look.
If you didn't change anything, go to web.config and find DefaultConnectionString. Thats where the data inserted and the table name is UserProfiles.
it creates a db file in App_Data folder.
If you use default settings then the Database Name where the Table will be installed is: aspnetdb. Also the table names are self explanatory as seen in below image. e.g. for MemberShip the table used is: dbo.aspnet_Membership.
The tool used to install these tables is aspnet_regsql.exe, and you can easily call it from
within a Visual Studio Command Prompt window

How to add more user fields in aspnetdb database?

I have created an ASPNETDB database on SQL Server 2008 for users, roles and profiles with Aspnet_regsql.exe.
But what I want to more user attributes apart from those default ones (name, email, mobile and comment), e.g. Postcode, Address, Telephone number, Rank, Position, etc. And also those new fields should be exposed to CreateNewUserWizard in the aspx page design mode, so that new user can be registered with more attributes.
I tried to add new columns in the "aspnet_Membership" table of ASPNETDB database. But they weren't automatically picked up.
Can anyone please give me some help on this? Thanks
Cheers,
Alex
Don't touch the database yourself. Follow the steps outlined here:
http://weblogs.asp.net/scottgu/archive/2005/10/18/427754.aspx
Note that you need to use the "Website" project template. Profiles are not supported out-of-the-box (without some customization) for the Web Application project template.
Please refer aspnet_Profile table
To add additional attributes columns you will need to create Profile Properties in web.config file and access this Properties and update the Profile of the currently created user.
If you have complex information about users then u can create your table and use the foreign key relation ship to UserId in aspnet_users table.
Check this MSDN ARTICLE
HOW TO ADD PROPERTIES for Profile
Complete details of using Profiles in Asp.net C# is explained in one of the answer on StackOverflow itself please refer how-to-assign-profile-values

How to localize SQL Server 2005 data to display in asp.net website

Can you please let me know how I can fetch the data from Sql Server 2005 Database in multiple different languages and display them in the ASP.NET application?
I am creating asp.net web site for global users with mulitple language support using .resx resource files and by changing the CurrentCulture and UICulture of asp.net page to the selected language by the user from the HomePage using System.Globalization and System.Threading namespaces
So far I have managed to display the User Interface on the page in different languages as I am fetching the control caption text message/images from the resource files but how can I display the data that fetched by the application inside asp.net page controls from sql server 2005 database similarly how to make the user filled the data on registration or anyother form in the selected language.
Can you please let me know
The simplest way (for static data) is to grab English data and translate it via standard resource files (treat English data as keys and read text from resource files).
Other option is to create Localization table with primary key based on string identifier and Culture identifier (i.e. 1033, 1036, etc.), containing translated texts and get translated data with appropriate query (this would require joining...).
The real problem could be dynamic (entered by users) data if you have it. You would need to rely on DB table like mentioned above, but you would need to create an interface in your application to allow content translation...

Invalid object name 'umbracoDomains'

I uploaded all the files of Umbraco CMS to the my http://blog.domain.com and also modified the web.config file. When I point to blog.domain.com, it is giving an error written in the subject. The hosting type for the subdomain is physical hosting not subdomain on subfolder
So, I have a second web.config file in this subdomain. The first one is in the main domain. I hoep this doesnt make a differnce.
Here's the screenshot: http://i.stack.imgur.com/PxSqq.jpg
I checked the database user with which I am trying to login in to the DB and it has the db_owner permissions for the database.
Also, I tried googling for the similar issues to see if someone with similar error had resolved the problem. Here are some pages but I haven't been able to find a solution.
Please help! This has been pending for long! :-(
When the Umbraco database is created, a new schema is created and all tables are created under this schema (eg. . rather than dbo.).
As the Umbraco website / db are copied, I assume that you changed the credentials, meaning the Umbraco data access layer may be trying to find tables ..
I have found that changing the schema to dbo resolves this problem and can be achieved (as long as only the Umbraco tables for you website are contained in the database) with the following SQL script:
exec sp_MSforeachtable 'ALTER SCHEMA dbo TRANSFER ?'
For more details, I have recently written an article on copying an Umbraco Website found at the following URL:
http://www.carbonsoft.co.uk/articles/2012/06/copying-an-umbraco-instance.aspx
Although this question was asked some time ago, I hope this helps others with similar problems,
You also get this error if you have no database in your connection string.
Umbraco's datalayer is (unfortunately) case-sensitive - which means that Umbraco can't find the table umbracoDomains. Check that the table is correctly named and/or cased - if your database is case-insensitive then make sure that all your tables are lowercased, as this should work.
carbonrb is right, when umbraco installation creates db it uses default credentials for db user. You can change schema to dbo like carbonrb advice or create user who has default schema the same as installed by umbraco. User cannot be in sysadmin role because it will override default schema back to dbo.

Using web.config to store and map info

I've been reading others questions regarding storing settings in the web.config. Most of you agree that's a good way to store settings.
I just have another doubt about that.
In my app, I need to map some ID's in the web.config. For example:
[Table = UserType]
1 - User
/2 - Admin
Is it a good idea to store these settings in the web.config so I know what is the right ID in my application? Do you have a better solution?
Thanks guys,
G
If that values doesn't change too often, it's better to create a enum to store that values. An enum sample could be:
enum UserType
{
User = 1,
Admin = 2
}
For more options, also take a look into [Flags] attribute: Enums, Flags, and C# — Oh my! (bad pun…)
Keep in mind every time you edit your web.config file, your IIS application pool get recycled.
I typically use the web.config to store things like connection strings, or key/value pairs that rarely [or never] change.
What you described would be ideal for an enum or perhaps a look up table in the database.
In my web application I have a number of "Configuration" settings that exceed the structure of the Web.Config file, and don't want the web site to restart after changing them.
I ended up creating a number of xml config files where the xml data maps to objects that get cached into collections. This allows us to change the config on the fly, while not restarting the web site. We have a filewatcher that triggers a reload of the cache objects from the Xml files when something in the configuration directory gets modified.
You can also use the database for this obviously, but in our case this was configuration data that is maintained by development and deployed with the build.

Resources