SqlCommand OpenCat = new SqlCommand(SQL, MainClass.Conn);
SqlDataReader readCat = new SqlDataReader();
try
{
readCat = OpenCat.ExecuteReader();
if (readCat.Read())
{
cmbPettyCashCode.Text = MainClass.SetDefo(readCat.GetValue(0).ToString(), "");
txtCatName.Text = MainClass.SetDefo(readCat.GetValue(1).ToString(), "");
readCat.Dispose();
}
else
{
readCat.Dispose();
}
}
catch (Exception error)
{
cmbPettyCashCode.Text = "";
MessageBox.Show(error.Message.ToString(), "Message", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
finally { }