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
Mfwamba Tshimanga
NA
155
46.5k
warning message (code not find)
Jul 5 2014 6:12 AM
Hello!
My codes are working well without problem. What I need? I would like to have a warning message when the code was not find. Where can I put it and how to write thse codes.
private void btnfindcod_Click(object sender, EventArgs e)
{
string connectionString = @"Data Source=localhost\sqlexpress;Initial Catalog=master;Integrated Security=True";
SqlConnection sqlCon = new SqlConnection(connectionString);
sqlCon.Open();
string commandString = "select * from company where code ='" + txtcode.Text + "'";
SqlCommand sqlCmd = new SqlCommand(commandString, sqlCon);
SqlDataReader read = sqlCmd.ExecuteReader();
while (read.Read())
{
txtprodut.Text = read["product"].ToString();
}
// It's probably here or not? ... code not found...
sqlCon.Close();
}
Reply
Answers (
4
)
print is not coming in asp.net
Asp.net vNext