Satyapriyanayal has posted "Login Page Using Stored Procedure" clearly...
I just want to tell you the CRUD operations using stored procedures.. I will give you sample stored procedures for CRUD operations
Lets say we have one table called Student with columns StudentID, StudentName, Marks
--C-Create and U-Update:
CREATE PROCEDURE CreateUSP
(
@P_StudentID int,
@P_StudentName VARCHAR(30),
@P_Marks int
)
AS
BEGIN
IF EXISTS ( SELECT StudentID FROM Student WHERE StudentID=@P_StudentID)
BEGIN
UPDATE Student SET StudentName = COALESCE(@P_StudentName, StudentName), Marks = @P_Marks
WHERE StudentID = @P_StudentID;
END
ELSE
BEGIN
INSERT INTO Student VALUES(@P_StudentID, @P_StudentName, @P_Marks)
END
END
GO
-- D= Delete
CREATE PROCEDURE DeleteUSP
(
@P_StudentID int
)
AS
BEGIN
DELETE FROM Student WHERE StudentID = @P_StudentID;
END
GO
-- R = Read/ Retrieve
CREATE PROCEDURE SelectUSP
(
@P_StudentID int
)
AS
BEGIN
SELECT * FROM Student WHERE StudentID = @P_StudentID;
END
GO
Please look into the
btn_login_Click() button click event code posted by "Satyapriyanayak" to understand the usage of stored procedure in C#...
Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif
Jprathap, if this helps please login to Mark As Answer. | Alert Moderator