protected void btnCadastro_Click(object sender, EventArgs e) { xx = new ClasseConexao(); ds = new DataSet(); ds = xx.executa_sql("insert into tblCliente values( '" + txtNome.Text + "', '" + txtSobrenome.Text + "', " + txtCPF.Text + ", " + txtCEP.Text + ", '" + txtCidade.Text + "', '" + txtEndereco.Text + "', getdate(), '" + txtNasc.Text + "', '" + txtEmail.Text + "', '" + txtPass.Text + "');"); Response.Redirect("index.aspx"); }
public List <List <String> > CarregaDados(String sql, bool colsFirst) { try { ds = new DataSet(); cs = new ClasseConexao(); ds = cs.executa_sql(sql); return(DataTableToMatrix(ds.Tables[0], colsFirst)); } catch { return(new List <List <string> >()); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { xx = new ClasseConexao(); ds = new DataSet(); ds = xx.executa_sql("select * from tblProduto where id_prod < 7"); dlProdutos.DataSource = ds.Tables[0]; dlProdutos.DataBind(); } catch (Exception) { } } }
protected void Page_Load(object sender, EventArgs e) { ClasseConexao xx = new ClasseConexao(); DataSet ds = new DataSet(); if (!IsPostBack) { try { xx = new ClasseConexao(); ds = new DataSet(); ds = xx.executa_sql("select * from tblProduto"); dlProdutos.DataSource = ds.Tables[0]; dlProdutos.DataBind(); } catch (Exception) { } finally { limpamenos(0); } } }
protected void btnLogin_Click(object sender, EventArgs e) { String v1 = txtUser.Text; String v2 = txtPass.Text; xx = new ClasseConexao(); ds = new DataSet(); ds = xx.executa_sql("select * from tblCliente where email = '" + v1 + "' and senha = '" + v2 + "'"); if (ds != null) { if (ds.Tables[0].Rows.Count > 0) { Response.Redirect("Index.aspx"); Session["idCliente"] = v1; Session["logado"] = "1"; } else { Session["logado"] = 0; System.Web.UI.ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AlertBox", "alert('Usúario e/ou Senha Incorretos');", true); } } }