Posts

Three tire Architecture

 3 tire Architecture    1- 3 tire architecture is used to create a layer for managing data transformation    2- There are following layer is used to create 3 tire architecture       i. Bussiness object layer       ii. bussiness logic layer      iii. data access layer 1.Bussiness object  create a variable 2.Bussiness logic    these layer directly connect to aspx page 3.Data access layer    only use database programming  Q.How to create layer  A- step 1: go to the solution explorer    step 2: right click on solution    step 3: add new project      step 4: select class library    step 5: create class file in each layer  In this concept create all types of classes related to data base structure  How to create class  BussinessObejct- userBO  Bussinesslogic- userBL  Dataaccess- userDA step: right click of the l...

Basic Query program(insert,update,delete,select)

 using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; public partial class task2 : System.Web.UI.Page {     SqlConnection cn;     SqlCommand cm;     SqlDataReader dr;     protected void Page_Load(object sender, EventArgs e)     {         if(!IsPostBack)         {         }     }     protected void Button1_Click(object sender, EventArgs e)     {         string k = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\college.mdf;Integrated Security=True;User Instance=True";         cn = new SqlConnection(k);         cn.Open();         string k1="insert into student values('"+TextBox1.Text+"', '"+TextBox2.Text+"', '"+TextBox3.Text+"','"+TextBox4.Tex...

sql notes

 datconncet database to web form(aspx) steps 1.include database library   SQLSERVER - library sqlclient   XML - library xml   ACCESS(excel) - library oledb How to use library  using system.data.library; eg. using system.data.sqlclient; step 2: create database object there are following object is used to create in a database  a.sqlconnection-representing database location/path  SYNTAX  sqlconnection objname; eg.sqlconnection cn; b.sqlcommand- representing all query(insert,update,select,delete)  SYNTAX sqlcommand objname; eg.sqlcommand cm; c.sqldatareader-it used to reading record from database(if we have to used select query then using datareader object) SYNTAX  sqldatareader objname; eg.sqldatareader dr; NOTE: all object is to be create before the page load step 3 Break the page reloading process(inside the page load event) if(!ispostback) { } DATABASE CODING(insert,update,delete,select and all query) step 1: Open connection step 2: Appl...

Detailview(program)

 using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; public partial class Dview1 : System.Web.UI.Page {     SqlConnection cn;     SqlCommand cm;     SqlDataReader dr;     protected void Page_Load(object sender, EventArgs e)     {         if (!IsPostBack)         {         }     }     protected void Button1_Click(object sender, EventArgs e)     {         string k = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\college.mdf;Integrated Security=True;User Instance=True";         cn = new SqlConnection(k);         cn.Open();         string k1 = "select * from student";         cm = new SqlCommand(k1, cn);     ...

Data transmission and query string

Data Transmission State management  session expire  query string  view state  cokkies application state session  1. Secure data transfermation  2. 60 sec of default time  3. how to create session      syntax            session["variable"]=control;           session["email"]=textbox1.text;    session is to be access in all website.  Q.how to access session?     All types of session is to be access inside the page load event  Query String 1. Query string is used to transfer data with URL 2. Query string does not use secure data tranfermation  3. Query string variable represent que mark.      Syntax Response.redirect("page.aspx?variable="+control); control=request.querystring["variable"]; Query string is to be acess in page load event   *Multiple variable in query string      (&)mpercent

Gridview

Gridview gridview start with 0 position syntax: string location = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\college.mdf;Integrated Security=True;User Instance=True";         cn = new SqlConnection(location);         cn.Open();         //how to bind grid view          string k = "select * from student";         cm = new SqlCommand(k, cn);         dr = cm.ExecuteReader();         GridView1.DataSource = dr;         GridView1.DataBind();         dr.Close(); Template in grid view     1.template id used to inserting control in a grid view     2.Only one property is used to template field      Template field- Header text grid view select- edit column- template field - header text (student mark) How to insert control  in this concept we have to u...

Database (Queries)

Database      Database is collection of entity(table).   college- database student- (roll,name,city) faculty- (name,designation,experiance) Types of database 1.local database 2. global database (web database) Database terminology: 1. Field (Representing the records)     roll  name          1    mohan      2    soham        Types of field 1. Single value field(roll no) 2. Multi value field(first name,last name,middle name) 3. Null value field(No compulsory data field Database Tupple (imp): Complete information in a table called tupple  Database Management:   With the help of key manage complete database key  key is a special type of field or managing complete information types of key 1. Primary key 2. Unique key  3. Foreign key Primary key   There are two properties  1. No blank 2. No repeat  eg. Roll no syntax: create table primary1 (...