My code:
public void FillMaxBankCode()
{
try
{
DataSet ds = new DataSet();
ds = bol.SelectMaxBankCode();
string j = ds.Tables[0].Rows[0].ToString();
txtbankid.Text = int.Parse(j); //ERROR HERE
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
public DataSet SelectMaxBankCode()
{
try
{
**Squery = "EXEC SelectMaxBankCode";**
return dal.DBread(Squery);
}
catch (Exception ex)
{
throw ex;
}
}
I am new to C# and the above code show error.. can anyone help?
txtbankid.Textproperty type is a string. Don’t useint.parse. There is no need to. Just do:txtbankid.Text = j;