このコードの何が問題になっていますか?SQL行から最後の値を取得し、それを。に表示したいと思いますTextBox
。親切に私を助けてください。
private void textBox2_Leave(object sender, EventArgs e)
{
cmd.Connection = cn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select last(remain) from item_new_customer where cust=" + textBox2.Text + "";
float h = (float)cmd.ExecuteScalar();
textBox20.Text = h.ToString();
}