Click here to Skip to main content
15,887,485 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionhi experts imgetting the error index out of rang pls help to solve Pin
sunil34-May-16 21:04
sunil34-May-16 21:04 
AnswerRe: hi experts imgetting the error index out of rang pls help to solve Pin
Richard MacCutchan4-May-16 22:58
mveRichard MacCutchan4-May-16 22:58 
AnswerRe: hi experts imgetting the error index out of rang pls help to solve Pin
Kunwar Bahadur Singh5-May-16 0:43
Kunwar Bahadur Singh5-May-16 0:43 
GeneralRe: hi experts imgetting the error index out of rang pls help to solve Pin
sunil35-May-16 1:56
sunil35-May-16 1:56 
AnswerRe: hi experts imgetting the error index out of rang pls help to solve Pin
John C Rayan12-May-16 2:47
professionalJohn C Rayan12-May-16 2:47 
GeneralRe: hi experts imgetting the error index out of rang pls help to solve Pin
Richard Deeming12-May-16 3:22
mveRichard Deeming12-May-16 3:22 
PraiseRe: hi experts imgetting the error index out of rang pls help to solve Pin
John C Rayan12-May-16 4:24
professionalJohn C Rayan12-May-16 4:24 
QuestionForm not sending Pin
Member 87616674-May-16 5:32
Member 87616674-May-16 5:32 
Hello

I have been trying for some time to log-in to a site who register.aspx page works (new user's details are inserted in the database).

However, when I use those same details of a user (email and password) to log-in, I am not able to. I get no debug errors in Visual Studio 2013 for Web or server errors. The form just stands still when I click the logon button.

Are there are glaring errors, please, in my log-on code? In my aspx file, the two form fields are ID = strEmail and ID = password:

 Protected Sub LogonBtn_Click(sender As System.Object, e As System.EventArgs) Handles LogonBtn.Click

        Try

            Using conn As OleDbConnection = New OleDbConnection(System.Configuration.ConfigurationManager.ConnectionStrings("students").ConnectionString)

                conn.Open()

                Dim strEmailValue As String = strEmail.Text
                Dim passwordValue As String = password.Text
                Dim MSAccess As String = "Provider=Microsoft.Jet.OleDb.4.0; Data Source=|DataDirectory|students.mdb;"
                Dim ConnectionString As String = "SELECT * FROM university WHERE strEmail = '" & strEmailValue & "' AND [password] = '" & passwordValue & "'"

                Dim cmd As New OleDbCommand

                Dim reader As OleDbDataReader = cmd.ExecuteReader

                Dim strEmailFound As Boolean = False

                Dim passwordFound As Boolean = False

                'if in database:

                While reader.Read

                    strEmailFound = True

                    strEmailValue = reader("strEmail")

                    passwordFound = True

                    passwordValue = reader("password")

                End While

                conn.Close()

                'check result

                If strEmailFound = True And passwordFound = True Then

                    Dim target = String.Format("~/userpage.aspx?strEmail={0}", strEmailValue)

                    Response.Redirect(target, True)

                End If

            End Using

        Catch ex As Exception

            Console.WriteLine(ex.Message)

            Dim MessageBox As String

            MessageBox = "Sorry, email or password not found"

        End Try

    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        'Dim strEmailValue As String = ""

        'Dim strEmailValue As String = strEmail.Text

        If Not IsPostBack Then

            strEmail.Text = String.Format("{0}", Request.QueryString("strEmail"))

        End If

        LblDate.Text = ReturnDate()

        strEmail.Focus()

    End Sub

End Class


Many thanks!
QuestionRe: Form not sending Pin
Richard MacCutchan4-May-16 5:57
mveRichard MacCutchan4-May-16 5:57 
AnswerRe: Form not sending Pin
Member 87616674-May-16 7:27
Member 87616674-May-16 7:27 
GeneralRe: Form not sending Pin
Richard MacCutchan4-May-16 9:33
mveRichard MacCutchan4-May-16 9:33 
GeneralRe: Form not sending Pin
Member 87616674-May-16 10:07
Member 87616674-May-16 10:07 
GeneralRe: Form not sending Pin
Richard MacCutchan4-May-16 20:51
mveRichard MacCutchan4-May-16 20:51 
GeneralRe: Form not sending Pin
Member 87616675-May-16 0:04
Member 87616675-May-16 0:04 
GeneralRe: Form not sending Pin
Richard MacCutchan5-May-16 0:13
mveRichard MacCutchan5-May-16 0:13 
GeneralRe: Form not sending Pin
Member 87616675-May-16 4:14
Member 87616675-May-16 4:14 
GeneralRe: Form not sending Pin
Richard MacCutchan5-May-16 5:04
mveRichard MacCutchan5-May-16 5:04 
AnswerRe: Form not sending Pin
Richard Deeming4-May-16 7:29
mveRichard Deeming4-May-16 7:29 
GeneralRe: Form not sending Pin
Member 87616674-May-16 8:05
Member 87616674-May-16 8:05 
Questionhi experts..im using AutoMapper for store procedure getting an error pls help Pin
sunil32-May-16 19:16
sunil32-May-16 19:16 
QuestionChat Client Programming Pin
MD_AS2-May-16 5:25
MD_AS2-May-16 5:25 
AnswerRe: Chat Client Programming Pin
Nathan Minier3-May-16 1:51
professionalNathan Minier3-May-16 1:51 
AnswerRe: Chat Client Programming Pin
aarif moh shaikh4-May-16 2:16
professionalaarif moh shaikh4-May-16 2:16 
QuestionDelete the Custom Control on Submit Button in ASP.Net Pin
Amit Kumar (India)2-May-16 2:05
Amit Kumar (India)2-May-16 2:05 
AnswerRe: Delete the Custom Control on Submit Button in ASP.Net Pin
F-ES Sitecore2-May-16 22:48
professionalF-ES Sitecore2-May-16 22:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.