Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
4
Reply
warning message (code not find)
Mfwamba Tshimanga
Jul 5 2014 6:12 AM
675
Reply
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();
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
increase row in database
Just don't repeat the same record please!