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
Anthony Clarke
NA
127
0
Populate whole datagridview column with date
Dec 8 2010 11:00 AM
Hi,
First of all, ill paste my bit of code and give an explanation of what im trying to accomplish and hope that you can help.
ETLSDataContext
CT =
new
ETLSDataContext
();
var
t =
from
f
in
CT.Dates
select
new
{
f.Date1
};
dataGridView1.DataSource = t;
dataGridView1.Columns.Add(
"D"
,
"DateNow"
);
dataGridView1.Columns.Add(
"E"
,
"DateDifference"
);
I have a SQL table with just Date1 in and use linq to pull it up
and the code i supplied shows me adding 2 other columns which are datenow and datedifference.
I need it so whenever the program loads it automatically populates the datagridview column "Datenow" with todays date and from there do some kind of a datediff query like
select datediff(Day, date1, datenow) as datedifference
I've been trying to do this all day and cannot come up with a solution and figured id ask the brain boxes.
Thanks for your time and patience.
Anthony
Reply
Answers (
4
)
How to Update an item in a list by LINQ
Help with creating a filter for a data grid!