locked
SqlDataReader RRS feed

  • Question

  • User-797751191 posted

    Hi

      I want sdr.read() should be executed if there is record else it should give message

    using (SqlDataReader sdr = cmd.ExecuteReader())
                    {
                        sdr.Read();
                        txtStoreAddress.Text = sdr["Address0"].ToString() + " " + sdr["Address1"].ToString();
                        txtStoreCity.Text = sdr["City"].ToString();
                        txtStorePostCode.Text = sdr["PostCode"].ToString();
                    }

    Thanks

    Wednesday, July 17, 2019 7:49 AM

Answers

All replies