Voided sub-process message

2

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
    
asked by Paul Julio 30.06.2017 в 19:24
source

1 answer

0

The sub-process error is voided because it is not allowed in ASP.NET to use a msgbox. you will have to look for another method to show the error.

You could use a user control that shows a modal form when returning, or a javascript that verifies the validity of the data.

    
answered by 30.06.2017 в 19:52