Esempio n. 1
0
        private void fillrpt()
        {
            string sqlQry = "select * from tblcomment where parentid is null" +
                            " order by id desc";
            DataSet ds = new DataSet();

            ds = dm.GetData(sqlQry);
            rptStatus.DataSource = ds;
            rptStatus.DataBind();
        }
        protected void btnReg_Click(object sender, EventArgs e)
        {
            string  sqlqry = "select * from tblUser where userName='******'";
            DataSet ds     = new DataSet();

            ds = dm.GetData(sqlqry);
            if (ds.Tables[0].Rows.Count > 0)
            {
                Label1.Text = "User Name is already exist...!";
            }
            else if (txtconfrm.Text != txtPassword.Text)
            {
                Label1.Text = "Password mismatch...!";
            }
            else
            {
                sqlqry = "insert into tblUser(userName,Passwo)" +
                         " values('" + txtInput.Text + "','" + txtconfrm.Text + "')";
                int i = dm.getupdate(sqlqry);
                if (i > 0)
                {
                    Response.Redirect("~/Login.aspx");
                }
                else
                {
                    Label1.Text = "Register Faild";
                }
            }
        }
Esempio n. 3
0
        protected void btnlogin_Click(object sender, EventArgs e)
        {
            DataSet ds = new DataSet();
            string  usrname;

            string sqlqry = "select * from tblUser where userName='******' AND Passwo = '" + txtPassword.Text + "'";

            ds = dm.GetData(sqlqry);
            if (ds.Tables[0].Rows.Count > 0)
            {
                usrname = ds.Tables[0].Rows[0]["userName"].ToString();
                Response.Redirect("~/soc.aspx?UserNames=" + usrname);
            }
            else
            {
                Label1.Text = "mis match....!!!";
            }
        }