Sunday, June 19, 2016
Out of the box the ASP.NET provider databases works with the local database file call aspnetdb.mdf, however in a production environment you cannot use this file because you need to work with the production database. To create the provider databases on a full version of SQL Server perform the following steps.
1. Navigate to the .NET Framework version that you want to use. Version 4.5 and Version 2 has the provider database wizard. I am using version 4.5 so the path is C:\Windows\Microsoft.NET\Framework\v4.0.30319
2. Double click on the file aspnet_regsql.exe, the ASP.NET SQL Server Setup Wizard will apear, click "Next" to continue
3. Select "Configure SQL Server for application services" radio button, then click next
4. Type in the database server name in the "Server:" field. Make sure you type in the actual host name because if you type in (local) or localhost the database creation process will fail. Leave the option as "Windows authentication" checked, unless you want to use SQL Server authentication. Then click "Next" to continue.
5. Click next on the confirmation screen
Now you have the databases necessary to work with the ASPNET provider services. However, you still need to change the configuration file maching.config in the .NET folder in order for .NET to recognize that the database is available in the SQL Server database now or the web.config file in your web application. The best practice is to change it in your web application so that it only affects your web application. If you change the configuration in machine.config file you will change to for all the applications.
This example shows you how to use the AspNetSqlMembershipProvider
1. First add the connection string to the database, make sure you have the <clear/> tag right below the <connectionStrings> opening tag
2. Now above the </system.web> tag type in the following
1. Navigate to the .NET Framework version that you want to use. Version 4.5 and Version 2 has the provider database wizard. I am using version 4.5 so the path is C:\Windows\Microsoft.NET\Framework\v4.0.30319
2. Double click on the file aspnet_regsql.exe, the ASP.NET SQL Server Setup Wizard will apear, click "Next" to continue
3. Select "Configure SQL Server for application services" radio button, then click next
4. Type in the database server name in the "Server:" field. Make sure you type in the actual host name because if you type in (local) or localhost the database creation process will fail. Leave the option as "Windows authentication" checked, unless you want to use SQL Server authentication. Then click "Next" to continue.
5. Click next on the confirmation screen
6. When the database has been successfully created you will see the message that says "The database has been created or modified"
7. If you look at the Microsoft Management Studio you will see the aspnetdb database in the list of databases.
Now you have the databases necessary to work with the ASPNET provider services. However, you still need to change the configuration file maching.config in the .NET folder in order for .NET to recognize that the database is available in the SQL Server database now or the web.config file in your web application. The best practice is to change it in your web application so that it only affects your web application. If you change the configuration in machine.config file you will change to for all the applications.
This example shows you how to use the AspNetSqlMembershipProvider
1. First add the connection string to the database, make sure you have the <clear/> tag right below the <connectionStrings> opening tag
<connectionStrings> <clear/> <add name="aspnetdbConnectionString" connectionString="Data Source=(local); Initial Catalog=aspnetdb;Integrated Security=True" providerName="System.Data.SqlClient" /> </connectionStrings>
2. Now above the </system.web> tag type in the following
<membership defaultProvider ="AspNetSqlMembershipProvider"> <providers> <add name="AspNetSqlProfileProvider" connectionStringName="aspnetdbConnectionString" applicationName="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> </providers> </membership>Note: To make sure you have the right provider settings copy the declaration from your machine.config file and then just change the "connectionStringName" attribute.
Subscribe to:
Post Comments (Atom)
Search This Blog
Tags
Web Development
Linux
Javascript
DATA
CentOS
ASPNET
SQL Server
Cloud Computing
ASP.NET Core
ASP.NET MVC
SQL
Virtualization
AWS
Database
ADO.NET
AngularJS
C#
CSS
EC2
Iaas
System Administrator
Azure
Computer Programming
JQuery
Coding
ASP.NET MVC 5
Entity Framework Core
Web Design
Infrastructure
Networking
Visual Studio
Errors
T-SQL
Ubuntu
Stored Procedures
ACME Bank
Bootstrap
Computer Networking
Entity Framework
Load Balancer
MongoDB
NoSQL
Node.js
Oracle
VirtualBox
Container
Docker
Fedora
Java
Source Control
git
ExpressJS
MySQL
NuGet
Blogger
Blogging
Bower.js
Data Science
JSON
JavaEE
Web Api
DBMS
DevOps
HTML5
MVC
SPA
Storage
github
AJAX
Big Data
Design Pattern
Eclipse IDE
Elastic IP
GIMP
Graphics Design
Heroku
Linux Mint
Postman
R
SSL
Security
Visual Studio Code
ASP.NET MVC 4
CLI
Linux Commands
Powershell
Python
Server
Software Development
Subnets
Telerik
VPC
Windows Server 2016
angular-seed
font-awesome
log4net
servlets
tomcat
AWS CloudWatch
Active Directory
Angular
Blockchain
Collections
Compatibility
Cryptocurrency
DIgital Life
DNS
Downloads
Google Blogger
Google Chrome
Google Fonts
Hadoop
IAM
KnockoutJS
LINQ
Linux Performance
Logging
Mobile-First
Open Source
Prototype
R Programming
Responsive
Route 53
S3
SELinux
Software
Unix
View
Web Forms
WildFly
XML
cshtml
githu
Mua vé máy bay tại Aivivu, tham khảo
ReplyDeletevé máy bay đi Mỹ bao nhiêu
đăng ký về việt nam ở mỹ
các chuyến bay từ narita về hà nội
vé máy bay khứ hồi từ đức về việt nam
vé máy bay từ Toronto về việt nam
Chuyến bay từ Hàn Quốc về Việt Nam
chuyen bay chuyen gia trung quoc