1 Replies - 1116 Views - Last Post: 04 August 2012 - 08:42 AM Rate Topic: -----

#1 tizzi09  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 6
  • Joined: 01-July 12

creating Login form

Posted 04 August 2012 - 06:21 AM

I have created a login form and did all the necessary coding I guess...Im still having bugs in my code
Can anyone kindly help me debug it and help my application work perfectly.Thanks.here is my code

 Imports System.Data.OleDb

Public Class Form1
    Dim con As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\HP\Documents\regData.accdb")

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try
            con.Open()
            Dim cmd As New OleDbCommand("SELECT from regData WHERE username = '" & txtUsername.Text & "' and pswrd = '" & txtPasswrd.Text & "'", con)
            Dim sdr As OleDbDataReader = cmd.ExecuteReader()
            If sdr.Read = True Then
                MsgBox("Login Successful")
            Else
                MsgBox("CHECK Username/Password")
            End If
            con.Close()
        Catch ex As Exception
            MsgBox("ERROR!")
        End Try
        
    End Sub



Is This A Good Question/Topic? 1
  • +

Replies To: creating Login form

#2 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5431
  • View blog
  • Posts: 11,642
  • Joined: 02-June 10

Re: creating Login form

Posted 04 August 2012 - 08:42 AM

Learning to debug one's own code is an essential skill. Sadly, one that apparently few college courses teach. Silly if you ask me.

Placing breakpoints and walking through the code line by line allows you to actually WATCH it execute.

Visualizing what your code does will let you see why it behaves the way it does.

It would be well worth your time to do the tutorials on FAQ 2. A couple hours learning this skill will save you hundreds of hours of confusion in one project alone.


See FAQ # 2. (Click the SHOW button below)



TOP most asked:
What does this error message mean?
FAQ 2: How do I debug
FAQ 3: How do I make Class1/Form1 talk to Class2/Form2


FAQ (Frequently Asked Questions - Updated July 2012
Spoiler



Was This Post Helpful? 0
  • +
  • -

Page 1 of 1