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
ta mu
NA
201
81.8k
if else condition
Oct 2 2013 3:25 PM
private void textBox8_Validated(object sender, EventArgs e)
{
SqlCommand cmd = new SqlCommand("SELECT model,fram_no,status FROM add_stock WHERE engen_no='" + textBox8.Text + "'", my);
my.Open();
SqlDataReader dr = cmd.ExecuteReader();
dr.Read();
if (dr.HasRows)
{
if (dr["status"].ToString() == "Sold")
{
MessageBox.Show("This Bike Is Sold");
textBox8.Text = "";
}
if (dr["status"].ToString() == "Available")
{
textBox16.Text = dr["model"].ToString();
textBox9.Text = dr["fram_no"].ToString();
}
}
else
{ MessageBox.Show("NOT A VALID ENGINE NO");
textBox8.Text = "";}
my.Close();
}
no error in code when i enter invalid no error messag shown bt when enter correct one no messag is diplayed for sold and not woks available code wahts wrong
Reply
Answers (
6
)
Getting Particular Part Of Website In C#
C# to take Outlook Message Body To Notepad