Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. if (sqlCon.State == ConnectionState.Closed)
  2. sqlCon.Open();
  3. string Query = "select * from tbl_article where NameArticle='"+comboBoxArt.Text+"'";
  4. SqlCommand cmd = new SqlCommand(Query, sqlCon);
  5. SqlDataReader myReader;
  6. try
  7. {
  8. myReader = cmd.ExecuteReader();
  9. while (myReader.Read())
  10. {
  11. txtName.Text = myReader.GetString("NameArticle");
  12. txtPrice.Text = myReader.GetInt32("PriceArticle").ToString();
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement