|
-
Sep 21st, 2011, 04:22 AM
#1
Thread Starter
Addicted Member
-
Sep 21st, 2011, 05:31 AM
#2
Re: Login dialog + Access db
Follow the CodeBank link in my signature and check out my WinForms Login thread.
-
Sep 23rd, 2011, 03:56 AM
#3
Thread Starter
Addicted Member
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
-
Sep 23rd, 2011, 05:51 AM
#4
Re: Login dialog + Access db
What's the signature of your 'userQuery' method?
-
Sep 23rd, 2011, 06:00 AM
#5
Thread Starter
Addicted Member
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 
Code:
Public Overloads Overridable Function userQuery() As String
-
Sep 23rd, 2011, 06:19 AM
#6
Thread Starter
Addicted Member
-
Sep 23rd, 2011, 06:30 AM
#7
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.
-
Sep 23rd, 2011, 06:54 AM
#8
Thread Starter
Addicted Member
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
-
Sep 23rd, 2011, 07:18 AM
#9
Thread Starter
Addicted Member
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
-
Sep 23rd, 2011, 07:33 AM
#10
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.
-
Sep 23rd, 2011, 08:15 AM
#11
Thread Starter
Addicted Member
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?
-
Sep 23rd, 2011, 03:27 PM
#12
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|