Hi All,
I sware I am loosing the will to live, I have tried to accomplish this by my-self for about 2 weeks now and I am still at square one, I prey someone can help me.
I am writing an application for booking conference rooms and I need a login form.
I have created my database called Users in sql and inserted 2 default login accounts, admin and default.
I dont know how to compare the data in my database to the data typed into the username and password text boxes on the login form.
Please see what I have so far
Imports System.Data.SqlClient
Public Class LoginForm1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
NewUser.Show()
End Sub
Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
Application.Exit()
End Sub
Private Sub LoginForm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim conn As SqlConnection
conn = New SqlConnection("Data Source=********;Initial Catalog=mtrmanager;Integrated Security=True")
Try
conn.Open()
Catch ex As Exception
MessageBox.Show("Connecting to Database Failed - Please Contact Systems Administrator")
End Try
End Sub
End Class
I know that I have to create a click event handler for the login button and put my code in there to compare the data, but can anyone help me out with the code before my head burns out.
Thanks very much
John