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
sonal malhotra
NA
410
52.3k
it does not display output well n pls fix my query with ef
Jan 3 2019 1:18 AM
hello ,
i had made two table as below
SELECT TOP 1000 [id]
,[Datetpublish]
,[statusid]
,[Title]
,[Author]
,[Content1]
FROM [blogstatus].[dbo].[Blogstatus]
SELECT TOP 1000 [statusid]
,[blogstatusname]
FROM [blogstatus].[dbo].[statusname]
in Index controller page
using (ctx = new blogstatusEntities1())
{
var publish = (from d in ctx.Blogstatus
join m in ctx.statusnames on d.statusid equals m.statusid
where m.statusid == 1
select new
{
id = d.id,
Datetpublish = d.Datetpublish,
Title = d.Title,
Author = d.Author,
Content1 = d.Content1
}).ToList();
return View(publish);
}
in view page
@using blogwithstatus.Models
@{
ViewBag.Title = "Index";
}
<h2> Blog news</h2>
<h6> list of blog</h6>
@using (var ctx = new blogstatusEntities1())
{
foreach (var blog in ctx.Blogstatus)
{
<div class="panel panel-body ">
<h3>
@blog.Title
</h3>
Author| @blog.Author
</div>
have u check my query in controller ? and i did wrong any query? please fix these query with ef
Reply
Answers (
4
)
why do we use delegate
Crystal report for c# .net visual studio 2010