I'm very new to Visual Basic.NET and I have the following problem. I want to login with Sql Server but when I enter the data and I accept it, I get a message:
"thread bypassed"
And I have to accept that it only works. How could I fix it?
Imports System.Data.SqlClient
Public Class Diseño
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim cn As String = "DATA SOURCE=RENZO\SQLEXPRESS;INITIAL CATALOG=INFORMATICA2050;INTEGRATED SECURITY=TRUE"
Dim da As New SqlDataAdapter
Dim dt As New DataTable
Dim comando As String = "select * from alumno where nombres = '" & txtUsuario.Text & "' and apellidos = '" & txtContraseña.Text & "'"
Try
da = New SqlDataAdapter(comando, cn)
da.Fill(dt)
If dt.Rows.Count <> 0 Then
Response.Redirect("NUEVOF.aspx")
Else
MsgBox("usuario o contraseña incorrecta")
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Class