i want to convert what i selected from the combobox so i can edit it or delete it, but the messege "cannot convert from string to int" keep showing
if (sqlCon.State == ConnectionState.Closed)
sqlCon.Open();
string Query = "select * from tbl_article where NameArticle='"+comboBoxArt.Text+"'";
SqlCommand cmd = new SqlCommand(Query, sqlCon);
SqlDataReader myReader;
try
{
myReader = cmd.ExecuteReader();
while (myReader.Read())
{
txtName.Text = myReader.GetString("NameArticle");
txtPrice.Text = myReader.GetInt32("PriceArticle").ToString();
}
}
and also when i run it, the selected item changes to his id "IdArticle". how can i fix this ??