TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ahmed salah
NA
85
58.6k
How to make function by c# to call stored proc from sql
Apr 27 2017 7:30 AM
I work in visual studio 2015 c# and i need to call stored procedure from sql 2012
and make function by c# to call stored procedure and retrieve one value string
in case name = @name
ALTER PROCEDURE [dbo].[ATC_Code_ByGeneric_H]
@Lvl_Name nvarchar(500)
AS
SELECT Tbl_Lvl1.Code + Tbl_Lvl2.Code + Tbl_Lvl3.Code + Tbl_Lvl4.Code + Tbl_Lvl5.Code AS ATC_Code
FROM Tbl_Lvl1
INNER JOIN
Tbl_Lvl2
ON Tbl_Lvl1.S_ID = Tbl_Lvl2.UpLvl_ID
INNER JOIN
Tbl_Lvl3
ON Tbl_Lvl2.S_ID = Tbl_Lvl3.UpLvl_ID
INNER JOIN
Tbl_Lvl4
ON Tbl_Lvl3.S_ID = Tbl_Lvl4.UpLvl_ID
INNER JOIN
Tbl_Lvl5
ON Tbl_Lvl4.S_ID = Tbl_Lvl5.UpLvl_ID
WHERE (Tbl_Lvl5.Lvl_Name = @Lvl_Name) and Tbl_Lvl5.human=1
RETURN
Actually i need to retrieve ATC_Code in case of Lv1_Name = @Lv1_Name
How to create function return string by c# to call stored procedure ?
Reply
Answers (
4
)
Best practise for change management
Scrolling down data automatically on Datagrid (...)