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
Hardik Patel
NA
378
468.2k
how to store value in variable from store procedure?
Jul 16 2013 4:45 AM
store procedure :
Set @total = ( select SUM(w.FinalAmount) from ChequeDetailsWO cdw
inner join WO w on cdw.WOCode = w.WOCode
inner join SupplierMaster sm on cdw.SupplierCode = sm.SupplierCode
inner join YearMaster ym on cdw.FinancialYear = ym.YearId
where AdvancePayment = 'true'
and cdw.SupplierCode = coalesce(@suppliercode,cdw.SupplierCode)
and cdw.WOCode = coalesce(@wocode,cdw.WOCode)
and cdw.FinancialYear = coalesce(@year,cdw.FinancialYear)
and w.WODate between coalesce(@datefrom,w.WODate) and coalesce(@dateto,w.WODate) )
select @total as 'tt', ym.Year 'Financial Year', sm.SupplierName,w.WONumber,Convert(nvarchar,w.WODate,106)'WODate',w.FinalAmount,cdw.ChequeNumber,Convert(nvarchar,cdw.ChequeDate,106)'ChequeDate',cdw.TDS from ChequeDetailsWO cdw
inner join WO w on cdw.WOCode = w.WOCode
inner join SupplierMaster sm on cdw.SupplierCode = sm.SupplierCode
inner join YearMaster ym on cdw.FinancialYear = ym.YearId
where AdvancePayment = 'true'
and cdw.SupplierCode = coalesce(@suppliercode,cdw.SupplierCode)
and cdw.WOCode = coalesce(@wocode,cdw.WOCode)
and cdw.FinancialYear = coalesce(@year,cdw.FinancialYear)
and w.WODate between coalesce(@datefrom,w.WODate) and coalesce(@dateto,w.WODate)
order by sm.SupplierName
i want to store @total on my page in variable "t"
t = ds.Tables[0].Rows[0]["@total"].ToString();
Label3.Text = t.ToString();
Reply
Answers (
3
)
MySql - Data From 3 tables -Left Joins
"Create small Project in MVC Operations with DB using LINQ:A