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
Vidhi Patel
NA
44
17.5k
I want to the controller in my sql query
Nov 14 2016 3:30 AM
Here is my controlller n above the first i put the sql function which i created.but in table Allocation filed data type is int so i have to convert that in double.
i want sql query which i display after execplian the things after write.
That function how to write in my controller plz guide me.
SELECT SID, RID, Schema_Name, SType, InvestmentType, Allocation, Lum_Sum_Amount, Allocation /100.0 * Lum_Sum_Amount as total FROM Schema_Details where RID = 1
this is my controller with method.....
public
ActionResult recommendedportfolio()
{
using
(var db =
new
WFTradeEntities())
{
return
View(db.Schema_Details.ToList());
}
}
[HttpPost]
public
ActionResult recommendedportfolio(
int
sName)
{
using
(var db =
new
WFTradeEntities())
{
var total = db.Schema_Details.Where(x => x.RID == sName)
.Select(x =>
new
{
Rid = x.RID,
Amount = Convert.ToDouble(x.Lum_Sum_Amount),
Allocation = Convert.ToDouble(x.Allocation),
total = ((x.Allocation / 100) * x.Lum_Sum_Amount)
}).ToList();
return
PartialView(
"_PortfolioTable"
, total);
}
}
and I am getting this error how can i solve it..
Reply
Answers (
1
)
When to use EnableViewState = "true" ?
How to call Web Api with User credential and get a token .