search

Google
 

Saturday, December 13, 2008

Web.config Changes after installing membership tables

After installing memership tables as illustrated in my previous blog 'Creating Membership Tables' we need to make changes in the web.config file as follows







The above code will remove the default database aspnetdb.mdf and point to new database where we are storing membership tables.

Tuesday, October 21, 2008

Creating Membership Tables

When you create a new ASP.NET 2.0 web site using Visual Studio 2005, you'll observe that a new folder App_Data gets created in the solution explorer, namely the aspnetdb.mdf file gets created. This extra database holds all the tables and stored procedures to let Membership, Roles, Profile etc run smoothly.

When the website is live and we want to use aspnetdb.mdf, we need to have an extra database webserver. Because of this reason we would like to have same database for tables and procedures of memebership and any other purpose that your site requires.

We have a possibility to have membership tables in a single database with the command
aspnet_regsql.exe.


We need to follow the below steps to install membership tables in your database with the command aspnet_regsql.exe.

Goto to the Visual Studio 2005 command Prompt.






MicrosoftSoft Visual Studio 2005->
Visual Studio Tools ->


Visual Studio 2005 Command prompt



Below is the command prompt window that gets opened and run the command aspnet_regsql.exe













Soon after you run the command, you will find the 'Welcome to the ASP.NET SQL server setup Wizard ' window opened.



Click next.



After clicking next 'Select a Setup Option' window gets opened.




Select the default or the other option depending upon the requirement.





Click next and note the 'Select the Server and Database' window gets opened.

Select the database and click next.



Note 'confirm your settings' window gets opened.


Confirm your settings and click next otherwise, go to previous window and change the settings.







Click next and note 'The database has been created or modified' window has been opened.


click finish.

Check the required tables are populated in the specified database.

Wednesday, April 9, 2008

How to disable right click

We can disable right click of our web pages through

document.oncontextmenu=new Function("return false;")

Tuesday, March 11, 2008

Access Specifiers in .net

The main purpose of using access specifiers is to provide security to the applications. The availability (scope) of the member objects of a class may be controlled using access specifiers.


PUBLIC

As the name specifies, it can be accessed from anywhere. If a member of a class is defined as public then it can be accessed anywhere in the class as well as outside the class. This means that objects can access and modify public fields, properties, methods.


PRIVATE

As the name suggests, it can't be accessed outside the class. Its the private property of the class and can be accessed only by the members of the class.


INTERNAL

Friend & Internal mean the same. Internal is used in C#. Friends can be accessed by all classes within an assembly but not from outside the assembly.


PROTECTED

Protected variables can be used within the class as well as the classes that inherites this class.


PROTECTED INTERNAL

The Protected Internal can be accessed by Members of the Assembly or the inheriting class, and ofcourse, within the class itself.

Execution process in .net

.NET applications aren’t executed the same way as the traditional Windows applications you might be used to creating.

Instead of being compiled into an executable containing native code, .NET application code is compiled into Microsoft intermediate language (MSIL) and stored in a file called an assembly.

At run time, the assembly is compiled to its final state by the CLR.

While running, the CLR provides memory management, type-safety checks, and other run-time tasks for the application.

Applications that run under the CLR are called managed code because the CLR takes care of many of the tasks that would have formerly been handled in the application’s executable itself.

Types of Applications in .net

There are four types

Web applications

These applications provide content from a server to client machines over the Internet. Users view the Web application through a Web browser.


Web services

These components provide processing services from a server to other applications over the Internet.


Internet-enabled applications

These are stand-alone applications that incorporate aspects of the Internet to provide online registration, Help, updates, or other services to the user over the Internet.


Peer-to-peer applications

These are stand-alone applications that use the Internet to communicate with other users running their own instances of the application.

Tuesday, February 5, 2008

How to change Default DataBase in SQL Server 2005

ALTER LOGIN [Login_Name] With default_database = [Database_Name]

Example:-

alter login sa with default_database = ourspace