Lab File 1
Lab File 1
Submitted To:-
Index
S.No 1.
Name Of exercise
2.
3.
4.
5. 6.
7.
Step-II Connect To Data Base Go to server explorer Do Right Click And click on Add connect
The fill the details as shown in fig. Step-III Add new Table
Step-V Open Default.aspx window and open GridView Tasks and the Select the Options as shown in fig., Then choose data source.
Step-VI: Add some stored procedures, these procedures tell what operations you want to perform.
Add Stored Procedures One by One With Following Code. Procedure For Delete Create PROCEDURE delemp ( @empno int ) AS delete from emp where empno=@empno RETURN
Procedure For update ALTER PROCEDURE updemp ( @empno int, @ename varchar(50), @eadd varchar(50), @esal int ) AS update emp set ename=@ename,eadd=@eadd,esal=@esal where empno=@empno RETURN Procedure For Insert ALTER PROCEDURE ins ( @empno int, @ename varchar(50), @eadd varchar(50), @esal int
) AS insert into emp values (@empno,@ename,@eadd,@esal) RETURN Procedure find ALTER PROCEDURE findemp ( @empno int ) AS select * from emp where empno=@empno RETURN Procedure For display or select ALTER PROCEDURE disemp AS select * from emp RETURN
Now you may check the output after clicking on start Debugging button.
STEP-VIII: Now Place 4 text boxes and one Insert Button From Tool Box.
Step-X Now Open the sqlDataSources Properties to have connection with text boxes.
Step-XI Now first Click On DeleteQuery IN SqlDataSource1s Properties, then Parameter Source Control and ControlID Textbox1
Repeate this step for InsertQuery, SelectQuery and UpdateQuery. Step-XII: Now you may check the output after clicking on start Debugging button
Now We can Insert, Delete , Select , Edit and Update any Row/Colum.