10 February 2013

9 February

i). Machine. Config

ii). Web.Config (For desktops app.Config)

Common paints for confn files:

  • These are simple text files & can be edited using any simple text editor.

  • These are xml formatted (case sensitive) & any xml programs can use these files or they can be directly edited because xml is human readable.

  • * They are automatically cached on memory for faster retrieval of settings (Cache memory àprogrammed memory area).

  • * Processed in hierarchical manner which means every configuration file inherits its parent configuration file settings. The root for all these files is Machine.Config.

  • Also called as configuration inheritance apart from this configuration is also hierarchical as xml is hierarchical.


Machine.Config points:

  • It is called per-server basis file. Only one machine.config is allowed for one runtime/server.

  • Located .NET framework folder not on our project & all settings are common to all websites running in that system. * 4 MB (default)(more than 4.0 go to machine.config – one file- change)

  • Most of the settings are maintained by administrator but not by application developers.

  • here we find all website settings(default) i.e., namespaces, services of support, net support, compileation settings, deploy settings, db settings ......


Web.Config points:

  • It is called as application Configuration file.

  • **** It is optional today also to have web.config in our application located in root & can be created sub folders also. We can create multiple web.config’s on our site maximum is how many folders we have in our project.

  • we can perform the following functionalities in web.config file:



  1.  Maintain connection strings

  2. Custom errors

  3. Security

  4. Debugging

  5. Tracing


----------------------------

The Cursor Process has the following steps involved in it: (exception handling in sp)

  • Declare a Cursor

  • Open a Cursor

  • Fetch data from the Cursor

  • Close the Cursor

  • De-allocate the Cursor


----------------------------

When a client, makes a request for an aspx page, it will be processed at server & all the result produced is concatenated as a single string along with some hash values in it.

These concatenated values are converted into base 64 format***. These base 64 values are stored in one or more hidden fields*** by server sent to client along with other from contents.

User adds/modifies the content & resubmits the form to server. Server first reads the hidden field values so that it retains the last given values (act as stateful) &responds the same process with new repeated as long as user is working with current page....

---------------------------

What is the scope of application variable?

  1. Accessible to all users of application, irrespective of the user who created it.

  2. The common memory area which is created in the webserver, which is common for all the users is k.led as App. Memory.

  3. Storing the data in this app.memory is k.ed App. state in State mngt. sys      

  4. .: The values stord by the webuser in the app memory, can be accessed by the other users also.                  

  5. The App State can store obj data types.

  6. App.State have to be used to store the Data which will be common for all the users of website.


---------------------------

All session variables are accessible to current user only.

Session variable are also of type object which means they can store any type of data (Load on server should be considered).

Session data will be stored @ server only & only session id travels. This data will be available as long as session is preserved by server. Sessions are normally ended based on timeout***.

In ASP.NET by default 20 min’s it the timeout (idle timeout) using configuration settings as well as programmatically with session object we can change this default time.

A session can be ended programmatically also. Session object has a method called Abandon () which kills the current session.

<system.web>

<SessionState timeout=”10”></SessionState>

-------------------------------

Untitled





Non.Persistent Cookies: These Cookies will be created in the browser's process area. They r not mentioned with Time duration. These Cookies will be destroyed when the app is closed

Persistent Cookies: The Cookies which are created & exists for a given time duration., is k.ld as the Persistent Cookie. They are created in the Client machine

Query string:                                                                                                                                                               Query string is Client side st.mngt sys. It can hold only strings. The Query string Memory will destroyed, when the app is closed.                                                                                                                                                The values Stored in Query string can be accessed from any page through out the app. In general Query string is used 2 carry small values from one to another page.

----------------------------

  1. Caching is the process of storing the page or objects in the cache memory of browse, proxy servers or webserver.      

  2. in general, caching is used to improve the performance i.e., the page or object that is cached will be accessed from the cache memory tor the next request with out fetching it from the db server.

  3. caching can be done at client side as well as server side.


These are 3 types of caching:

client side caching:

  • output page caching (or) entire page caching

  • fragment caching (or) partial page caching


server side caching:

  • data caching (or) object caching.


using system.web.caching;

//create{                                                                                                                                                                                                            CacheDependency cd = new Cache Dependency(Server.MapPath("XMLfile.xml"), Cache.Insert("key1",ds.Tables[0]),cd,DateTime.Now.AddMinutes(10),Cache.NoSlidingExpression);              }

//get{                                                                                                                                                                                         gv1.DataSource = (DataTable)Cache.Get("key1");                                                                                                                      gv1.DataBind();                                                                                                                                                                                             }

  1. Obj caching or data caching is server side State Management Sys.

  2. we can create this kind of caching in 2 cryterious



  • cache dependency: By using this, cache memory will be destroyed if the dependent file is modified.

  • cache expiration: By using this parameter, cache mem. will be destroyed with in a given time after the creation.


-----------------------------

Primary Key:
Primary Key enforces uniqueness of the column on which they are defined.
Primary Key creates a clustered index on the column.
Primary Key does not allow Nulls.

CREATE TABLE EMP (eID INT NOT NULL PRIMARY KEY,
eName VARCHAR(100) NOT NULL)

Alter table with Primary Key:
ALTER TABLE EMP
ADD CONSTRAINT pk_eID PRIMARY KEY (eID)

Unique Key:
Unique Key enforces uniqueness of the column on which they are defined.
Unique Key creates a non-clustered index on the column.
Unique Key allows only one NULL Value.

Alter table to add unique constraint to column:
ALTER TABLE EMP ADD CONSTRAINT UK_empName UNIQUE(empName)

No comments: