protected void BtnAdd_Click(object sender, EventArgs e) { dt1 = obj.CheckAdminMobilenumber(txtno.Text); if (dt1.Rows.Count > 0) { str = "Welcome Admin Your UserName Is::" + dt1.Rows[0]["username"].ToString() + "Your Password Is::" + dt1.Rows[0]["pwd"].ToString(); SendSMS(txtno.Text, str); txtno.Text = ""; } if (dt1.Rows.Count <= 0) { dt2 = obj.CheckStafMobilenumber(txtno.Text); if (dt2.Rows.Count > 0) { str = "Welcome Staff Your Username Is::" + dt2.Rows[0]["username"].ToString() + "Your Password Is::" + dt2.Rows[0]["pwd"].ToString(); SendSMS(txtno.Text, str); txtno.Text = ""; } if (dt2.Rows.Count <= 0) { dt3 = obj.CheckeacherMobilenumber(txtno.Text); if (dt3.Rows.Count > 0) { str = "Welcome Teacher Your Username Is::" + dt3.Rows[0]["username"].ToString() + "Your Password Is::" + dt3.Rows[0]["pwd"].ToString(); SendSMS(txtno.Text, str); lblmsg.Text = "Details Has Been Sent"; txtno.Text = ""; } if (dt3.Rows.Count <= 0) { lblmsg.Text = "Mobile No. Is Invalid"; txtno.Text = ""; } } } }