Stored proedure in c#
hi sir... i wana sample stored procedure example can u please snd me create a stored procedure in sqlserver and using c# we can update it this is the question please sit i want to know the concept of stored procedure... actually i am learning dotnet self so please help me
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 29, 2013, 11:51 PM EDT
CREATE PROCEDURE usp_SelectRecord
AS
BEGIN
SELECT *
FROM TABLE
END
GO
EXEC usp_SelectRecord
you can check this link for insert stored procedure in C# example
http://www.c-sharpcorner.com/uploadfile/jitendra1987/sql-server-stored-procedure-with-C-Sharp-net/
Sunny SharmaRank #223 · 11.1K reputationPosted Jul 29, 2013, 11:56 PM EDT
Follow this post:http://support.microsoft.com/kb/320916
It has all the example and explanations that you need to know.
Happy Coding :)
Cheers!
Anurag SarkarRank #1,049 · 1.8K reputationPosted Jul 30, 2013, 12:30 AM EDT
You can use them in C# using SqlCommanad Class.
Example:-
cmd=new SqlCommand("storeprocname",con); cmd.commandtype=CommandType.StoredProcedure;
cmd.executeNonQuery;
Thanks.