v ViewState :- I. It is used to store data value in a single webpage. II. The ViewState cannot transfer the data between one page to another page . v How to create ViewState? Sytanx:- ViewState[“var”]=Control; Ex.- ViewState[“Email”]=Textbox1.text; v How to access ViewState data value? Syntax:-control=ViewState[“var”].Tostring(); Ex:-Label1.text=ViewState[“Email”].tostring(); Code:- using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace WebApplication1 { public partial class stateview : System.Web.UI.Page { protected void Page_Load( object sender, EventArgs e) { ...
Ø Store procedure Data Base handling (procedure_insert). 1. Include procdure library (system.data). 2. Pass procedure name to sqlcommand parameters. Syntax :- com= new sqlcommand(“procedure name”,connection object) 3. Set the command type (store procedure) Syntax :-com.CommandType=commandtype.storeprocedure STORE PROCEDURE CREATE PROCEDURE PROCON ( @ROLL1 AS INT , @NAME1 AS VARCHAR ( 50 )) AS BEGIN INSERT INTO DEMO ( ROLL , NAME ) VALUES ( @ROLL1 , @NAME1 ) END ; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient; public partial class ...
l Database joining :- 1. Joining is a special type of operation perform between 2 tables. 2. With the help of joining we get the result between multiple data. l Joining property:- 1. Common field (column) 2. Using table object Syntax :- table name.column name 3. To activate joining operaton we need ON KEYWORD. ü TYPES OF JOINING:- 1. INNER JOIN :- Inner join returns all records from multiple data where the join condition is equal. Ex:- CREATE TABLE invent ( id INT , name VARCHAR ( 20 )); INSERT INTO invent values ( 101 , 'rahul' ),( 103 , 'thosar' ),( 102 , 'asus' ); CREATE TABLE product ( id INT , cost int ); INSERT INTO product VALUES ( 201 , '1000' ),( 202 , '2000' ),( 203 , '30000' ); SELECT invent . id , invent . name , product . cost FROM invent INN...
Comments
Post a Comment