Create Procedure TotalCount_Sp
As
Begin
SELECT((Select ISNULL(SUM(Tbl_StartupBanner.Price),0) FROM Tbl_StartupBanner) +
(Select ISNULL(SUM(Tbl_SignInBanner.Price),0) FROM Tbl_SignInBanner)+
(Select ISNULL(SUM(Tbl_SignOutBanner.Price),0) FROM Tbl_SignOutBanner)+
(Select ISNULL(SUM(Tbl_HeaderBanner.Price),0) FROM Tbl_HeaderBanner)+
(Select ISNULL(SUM(Tbl_FooterBanner.Price),0) FROM Tbl_FooterBanner)+
(Select ISNULL(SUM(Tbl_WebSpreadBanner.Price),0) FROM Tbl_WebSpreadBanner)
) as Total
End


Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Mar 3, 2014, 8:16 PM EST
You can do something like,
Dim con As New SqlConnection("your connection string here")
con.Open()
Dim com As New SqlCommand("TotalCount_Sp", con)
com.CommandType = CommandType.StoredProcedure
Dim total As Integer = com.ExecuteScalar()
con.Close()
labelMaster.Text = total
Or else,
Read this blog
www.c-sharpcorner.com/Blogs/11462/
Sai Prasad Anumolu175 reputationPosted Mar 3, 2014, 8:31 PM EST