Ok I got just one question that I can’t quite figure out.
Any and all help is much appreciated.
I am using VS 2010 and MS
The project that I am working on will include a MS Access database (\Database\DB.mdb)
The database will be mainly used to keep track on User information.
I have a Table (UserTable) and some Fields (ID, Username, Password, Active, Level, Notes)
The question is: How can I get the Level value by searching for the UserName?
Thanks for the read, hope you can help.
I was thinking something like:
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim dbLevel As String
Using connObj As New SqlClient.SqlConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath & "\Database\DB.mdb; Jet OLEDB:Database Password=1qa@WS3ed$RF;") Using cmdObj As New SqlClient.SqlCommand("select Level from UserTable where UserName = 'Test1'", connObj)
Using readerObj As SqlClient.SqlDataReader = cmdObj.ExecuteReader
dbLevel = readerObj("Level").ToString
MessageBox.Show("Your variable is: " & dbLevel.ToString)
But I cannot get it work as I do no know if: " Using cmdObj As New SqlClient.SqlCommand" is correct.