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
690
1.3k
219.6k
Change label's button color when click with condition
Nov 3 2016 11:11 AM
Hi,
I have one label(lbl_signal):
Then when I run my program my label will receive data from a specific column's database like this:
string
connectionString =
@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Foods\App_Data\office.mdb;Persist Security Info=False"
;
OleDbConnection
sqlCon = new
OleDbConnection
(connectionString);
sqlCon.Open();
string
commandString =
"select * from myTable where S ='" + "*" + "'"
;
OleDbCommand
sqlCmd =
new
OleDbCommand
(commandString, sqlCon);
OleDbDataReader
read = sqlCmd.ExecuteReader();
if
(read.HasRows)
{
while
(read.Read())
{
lbl_signal.Text = read[
"signal"
].ToString();
}
}
else
{
//line of code
}
read.Close();
sqlCon.Close();
Then if there is a word
connected
it's should be automatically in green's color. If its
disconnected
it's should be automatically in red's color.
How can I do it with a condition please?
Thanx,
Israel.
Reply
Answers (
3
)
performance issue
how to get google map on normal view page in mvc