Ver Mensaje Individual
  #8 (permalink)  
Antiguo 29/04/2005, 05:29
Avatar de Jose_minglein2
Jose_minglein2
 
Fecha de Ingreso: noviembre-2004
Mensajes: 2.344
Antigüedad: 19 años, 6 meses
Puntos: 8
porque no haces???:

string correo=correo.text
string clave=clave.text

??

Por cierto no cierras el page load antes de button_registro??????????

Yo lo podría así:


public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Button boton_registro;
protected System.Web.UI.WebControls.LinkButton boton_aqui;
protected System.Web.UI.WebControls.TextBox correo;
protected System.Web.UI.WebControls.TextBox clave;
protected System.Web.UI.WebControls.Label mensaje;

private void Page_Load(object sender, System.EventArgs e)
{
}
private void boton_registro_Click(object sender, System.EventArgs e)
{

//Almacenamiento del correo y la clave
string correo=string correo=correo.text;
string clave=clave.text;

//ESTABLECEMOS TODAS LAS INTRUCCIONES DE LA BD
//MANEJO DE LA INFORMACION

string sqlquery = "SELECT * FROM Persona WHERE (correo="+correo+" AND clave="+clave+")";
string ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Inetpub\\wwwroot\\proyecto\\bd.mdb";
OleDbConnection con = new OleDbConnection(ConnectionString);
OleDbCommand cmd = new OleDbCommand(sqlquery,con);


con.Open();
cmd.ExecuteNonQuery();

object resultquery=cmd.ExecuteScalar();

if(int.Parse(resultquery.ToString())>0)
{

this.Response.Redirect("WebForm3.aspx");
}
else
{
this.Response.Write("ERROR");
}

con.Close();
}
}