Re: Login dialog + Access db
Follow the CodeBank link in my signature and check out my WinForms Login thread.
Re: Login dialog + Access db
^^
thanks so much, this really helped me...
but I have small issue in my code...
Here I get error "Too many arguments to "Public ReadOnly Default Property Chars(index As Integer) As Char"
On Return ... Me.PasswordTextBox.Text
Code:
Private Function ValidateCredentialsByTableAdapter() As Boolean
Using adapter As New dbloginDataSetTableAdapters.useriTableAdapter
Return adapter.userQuery(Me.UsernameTextBox.Text.Trim(), Me.PasswordTextBox.Text).Value > 0
End Using
End Function
:thumb:
Re: Login dialog + Access db
What's the signature of your 'userQuery' method?
Re: Login dialog + Access db
Thanks, I have find my problem...
This is in yours example
Code:
Public Overridable Overloads Function GetUserCountByUserNameAndPassword(ByVal UserName As String, ByVal Password As String) As Global.System.Nullable(Of Integer)
And this was in my :D
Code:
Public Overloads Overridable Function userQuery() As String
Re: Login dialog + Access db
Hm... :o
Again some mistake...
When I run APP Cancel button works great but OK button doesn't...
If I press OK with empty or filed text boxes this is what I get... :confused:
http://dl.dropbox.com/u/10264724/programiranje/1.PNG
Re: Login dialog + Access db
First things first, you should turn Option Strict On for this and all other projects. That error would have been picked up at compile time instead of slipping through to run time. I think the error message should speak for itself. You're passing a String where an Integer is expected. If you're validating credentials then obviously you want to pass text and not numbers, so you have designed your query incorrectly.
Re: Login dialog + Access db
Thanks!
You are correct, it was query...
Now it works but now when I insert username and password nothing happens, form doesn't open and I cant find my problem :(
Re: Login dialog + Access db
Of course, I did this with Me.Hide and Form.Show but Im interested how did you do it because I cant find it :)
Re: Login dialog + Access db
I've already provided you with specific instructions on how to do it. If you follow those instructions then it will work. If it doesn't work then you didn't follow the instructions. I can't possibly say what you have done wrong because I haven't seen what you've done.
Re: Login dialog + Access db
I made some small changes and it works now so thanks very much for this :)
I have one more question, maybe you can help me...
I have setup project for one project and when I build this project Access database is empty...
This means I dont have any username and password to login with...
Is there some option not to delete data from Access when building setup project?
Re: Login dialog + Access db
Building a Setup project doesn't delete any data. When you build your project, the source database is copied from the source folder to the output folder. This applies to Debug and Release builds. Any changes you make while debugging are only made to the copy in the Debug folder. If you want standard data in the database all the time then it must be in the source database, so it will then also be in every copy.