VB Login One Time Code Usage

April 19, 2012 at 00:58:23
Specs: Windows 7, Core i5 / 4gb
I am using VB 2008 Express Edition and want to create a login form where the users have their own code to login..
the login issue are solved... able to work with SQL Server 2008..able to retrieve info from database and show it..

my current problem is to limit the usage of code to one-time-only usage..
hopefully you guys can help me with this..
Below is my coding for the authentication page..

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim connection As New SqlClient.SqlConnection
Dim command As New SqlClient.SqlCommand
Dim adaptor As New SqlClient.SqlDataAdapter
Dim dataset As New DataSet

connection.ConnectionString = ("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Stdlist.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True")

command.CommandText = "SELECT * FROM [Stdlist] WHERE Authcode = '" & TextBox1.Text & "';"

command.Connection = connection

adaptor.SelectCommand = command
adaptor.Fill(dataset, "0")

Dim count = dataset.Tables(0).Rows.Count

If count > 0 Then

Me.StdlistBindingSource.Filter = "Authcode = '" & Me.TextBox1.Text & "'"

MsgBox("Error Authentication Code. Please check again your Authentication Code", MsgBoxStyle.Critical)

End If

End Sub

See More: VB Login One Time Code Usage

Report •

April 19, 2012 at 07:47:00
Hey. Hey. Hey.
Compile your program, go to this TextBox1, and enter the following:
'; DROP TABLE Stdlist;--
Then report back.

How To Ask Questions The Smart Way

Report •

April 19, 2012 at 14:28:01

Report •

Related Solutions

Ask Question