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
aditya immadi
NA
215
23.8k
datatable is not loading
Jun 27 2016 7:05 AM
Hai all i tried this for showing records which has date after today..in mvc
}
public ActionResult ActiveRecords()
{
var dateAndTime = DateTime.Now;
var ydate = dateAndTime.Date;
DataTable dt = _obj.activeR(ydate);
return View();
}
and in my Dal.cs
internal DataTable activeR(DateTime ydate)
{
SqlConnection con = new SqlConnection(s);
SqlCommand cmd = new SqlCommand("sb_calender", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@EndDate", ydate);
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
sda.Fill(dt);--
-table is not loading here
return dt;
}
finaly my stored procedure is
alter proc sb_calender
@EndDate date
as
begin
select * from tb_calender WHERE @EndDate > CONVERT(DATETIME,CONVERT(NVARCHAR(10),GETDATE(),121))
end
is this the correct way to do this
or anything else....if yes please help me ..
TIA
Reply
Answers (
2
)
How to Insert and Display Image or File in Php Using MySql D
Custom Tool Generator