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
Israel
698
1.3k
217.6k
two dates to found in with the name "x"
Dec 22 2014 6:44 PM
Hi!
I would like to make filter between two
dates
and
name
(
for instance, show me between
20/12/2014
to
24/12/2014
where the name
Sham
is found)
:
conn.Open();
OleDbCommand cmd = conn.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from
company
where
data
between ? and ?";
var param1 = new OleDbParameter("@StartDate", OleDbType.Date);
var param2 = new OleDbParameter("@EndDate", OleDbType.Date);
param1.Value = dataStart.Value.Date;
param2.Value = dataEnd.Value.Date;
if (dataStart.Value <= dataEnd.Value)
{
cmd.Parameters.Add(param1);
cmd.Parameters.Add(param2);
}
else
{
cmd.Parameters.Add(param2);
cmd.Parameters.Add(param1);
}
cmd.ExecuteNonQuery();
DataTable dt = new DataTable();
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
da.Fill(dt);
conn.Close();
dataGridView1.DataSource = dt;
}
Reply
Answers (
2
)
Display image in Datagrid row from file system in LightSwitc
Compare and update file contents in folders (source,target)