Foros del Web » Programación para mayores de 30 ;) » .NET »

problema con el login

Estas en el tema de problema con el login en el foro de .NET en Foros del Web. tengo este codigo sencillo q me levanta a 1 pagina Cita: <%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %> <%@ Import Namespace = "System.Data"%> <%@ Import Namespace ...
  #1 (permalink)  
Antiguo 03/05/2008, 10:56
 
Fecha de Ingreso: marzo-2008
Mensajes: 286
Antigüedad: 16 años, 2 meses
Puntos: 1
problema con el login

tengo este codigo sencillo q me levanta a 1 pagina

Cita:
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@ Import Namespace = "System.Data"%>
<%@ Import Namespace = "System.Data.SqlCliente"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script runat="server">
Sub Evaluar(obj as object, e as eventargs)
dim conexionesglo as new SqlConnection()
conexionesglo.connectionString=Application("conect a")
Dim cmd as New SqlConnection("select * from Usuarios where " & _
"UsuarioRegistro='" & txtUsuario.Text & "'",conexionesglo)
dim dr as SqlDataReader
conexionesglo.Open()
dr=cmd.ExecuteReader(CommandBehavior.SingleRow)
if dr.Read then
if dr("Clave")= txtClave.Text
dr.close()
conexionesglo()

Response.Redirect("insertar.aspx")<br />
else
lblMensaje.Text="La contraseña no es la correcta"
End if
Else
lblMensaje.Text="El Usuario no existe"
end if
end sub
Sub LimparTextBox(obj As Object, e As eventargs)
txtUsuario.text=""
txtClave.text=""
End sub



</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
</head>
<body>
<form action="" method="post" name="form1" id="form1" runat="server">
<p>
<asp:Label ID="lblUsuario" Text="Usuario" runat="server" />
<asp:TextBox ID="txtUsuario" runat="server" />
<br />
<asp:Label ID="lblClave" runat="server" Text='contraseña' />
<asp:TextBox ID="txtClave" TextMode="Password" runat="server" />
</p>
<p>
<asp:Button ID="btnAceptar" Text="Aceptar" runat="server" />
<asp:Button ID="btLimpiar" Text="Limpiar" runat="server" />
<br />
</p>
</form>
</body>
</html>
y me da el error aca

Line 10: dim conex as new SqlConnection()
Compiler Error Message: BC30002: Type 'SqlConnection' is not defined.

mi conexionesglo es 1 conexion ya creada ....capaz deba colocarla d otra forma....
  #2 (permalink)  
Antiguo 03/05/2008, 11:37
 
Fecha de Ingreso: marzo-2008
Mensajes: 286
Antigüedad: 16 años, 2 meses
Puntos: 1
Re: problema con el login

ya arregle el problema ....ahora tengo 1 error ....aca en la linea

Dim cmd as New SqlConnection("select * from Usuarios where " & "UsuarioRegistro='" & txtUsuario.Text & "'",conexionesglo)

me da este error
Overload resolution failed because no accessible 'New' accepts this number of arguments
  #3 (permalink)  
Antiguo 03/05/2008, 11:45
 
Fecha de Ingreso: marzo-2008
Mensajes: 286
Antigüedad: 16 años, 2 meses
Puntos: 1
Re: problema con el login

ya levante la pagina ...pero no manda al response.redirect...saben xk puede ser ??
  #4 (permalink)  
Antiguo 03/05/2008, 11:49
 
Fecha de Ingreso: marzo-2008
Mensajes: 286
Antigüedad: 16 años, 2 meses
Puntos: 1
Re: problema con el login

alguna ayuda ??
  #5 (permalink)  
Antiguo 05/05/2008, 08:37
 
Fecha de Ingreso: marzo-2008
Mensajes: 286
Antigüedad: 16 años, 2 meses
Puntos: 1
Re: problema con el login

no se si tienen alguna solucion a mi problema..
  #6 (permalink)  
Antiguo 05/05/2008, 09:24
 
Fecha de Ingreso: marzo-2008
Mensajes: 286
Antigüedad: 16 años, 2 meses
Puntos: 1
Re: problema con el login

Cita:
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@ Import Namespace = "System.Data"%>
<%@ Import Namespace = "System.Data.SqlClient"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script runat="server">

sub Evaluar(obj as object, e as eventargs)

dim conexionesglo as new SqlConnection()
conexionesglo.connectionString=Application("conect a")
Dim cmd as New SqlCommand("select * from Usuarios where " & "UsuarioRegistro='" & txtUsuario.Text & "'",conexionesglo)
dim dr as SqlDataReader
conexionesglo.Open()
dr=cmd.ExecuteReader(CommandBehavior.SingleRow)
if dr.Read then
if dr("Clave")= txtClave.Text then
dr.close()
conexionesglo.close()
Response.Redirect("mantenimientoproveedores.aspx")
else
lblMensaje.Text="La contraseña no es la correcta"
End if
Else
lblMensaje.Text="El Usuario no existe"
end if
end sub

sub LimparTextBox(obj As Object, e As eventargs)
txtUsuario.text=""
txtClave.text=""
End sub



</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
</head>
<body>
<form action="" method="post" name="form1" id="form1" runat="server">
<p>
<asp:Label ID="lblUsuario" Text="Usuario" runat="server" />
<asp:TextBox ID="txtUsuario" runat="server" />
<br />
<asp:Label ID="lblClave" runat="server" Text='contraseña' />
<asp:TextBox ID="txtClave" TextMode="Password" runat="server" />
<br />
<br />
<asp:Label ID="lblMensaje" runat="server" />
</p>
<p>
<asp:Button ID="btnAceptar" Text="Aceptar" runat="server" />
<asp:Button ID="btLimpiar" Text="Limpiar" runat="server" />
<br />
</p>
</form>
</body>
</html>
el codigo esta asi..pero no me deja llevar a la sgte pagina
  #7 (permalink)  
Antiguo 05/05/2008, 09:26
 
Fecha de Ingreso: abril-2005
Ubicación: GUANAJUATO,MEXICO
Mensajes: 216
Antigüedad: 19 años
Puntos: 0
Re: problema con el login

Checa bien la ruta de tu pagina, lo que veo en el codigo significa que la pagina a la cual estas redireccionado que encuentra al mismo nivel que la pagina del login, si la pagina a la cualq uieres redireccionar esta dentro de una carpeta debes de poner lo siguiente Response.Redirect("~/Folder/paginaredireccionada.aspx"), espero te ayude esto.
  #8 (permalink)  
Antiguo 05/05/2008, 10:15
 
Fecha de Ingreso: marzo-2008
Mensajes: 286
Antigüedad: 16 años, 2 meses
Puntos: 1
Re: problema con el login

no esta en otro formulario ...los 2 estan en la misma carpeta.... en el btn onclick del q es enviar tendria q poner algo??'
capaz el sub evaluar ???
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:31.