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
693
1.3k
219.4k
Time must be egual to data system
Sep 29 2019 4:50 PM
Hi,
I have on my form a Timer1, Label1 and Label2.
Then on my OnLoad Event I put:
Timer1.Start();
conn =
new
SqlConnection(
"Data Source = (LocalDB)\\MSSQLLocalDB; AttachDbFilename=C:\\myFolder\\App_Datas\\DB.mdf;Integrated Security = True;Integrated Security = True"
);
conn.Open();
string
commandString =
"select top 1 * from operation where S='"
+
"S"
+
"' order by nord desc"
;
SqlCommand comm =
new
SqlCommand(commandString, conn);
SqlDataReader read = comm.ExecuteReader();
if
(read.HasRows)
{
while
(read.Read())
{
Label1.Text = read[
"time"
].ToString();
}
}
else
{
}
read.Close();
conn.Close();
if
Label1.Text = DateTime.Now.ToString()
Label2.txt =
"Yes"
;
On my timer_Click I put this:
Label1.Text = DateTime.Now.ToString(
"HH:mm"
);
What I need?
When the time its equal to the date system its should display on Label2 the word "yes". Otherwise its cant activate the second Label2.
Reply
Answers (
3
)
web api on ajax call
how to get local machine ip address in .net core 2.2