I'm a few day's searching for a problem, but can't find the answer. They are 1000 examples on youtube "how to make a login frm" but not in VB 2012 are by useing a selfmade database in VB.
So I already have a Bindingsource, Tableadapter, TableAdapterManager and a DatabaseDataSet en working with an tablegrid. Now I want to login to the system first before I get acces to the other parts of the program. The user have to write his name in to a textbox and when his names is existing (in the database), he get acces.
My problem is to check the column "users". What code can I use for that pleas?
Ideally You want the user to enter his/her username and password
FIRST
and then in the btnSubmit_Click event you should query the data sourceNEXT
and check if the results are valid.It is not recommended to load all the usernames/passwords and then look for a match.
It is `better/safer' to query ONLY for the single username/password pair.
This is not the EXACT code, but something along these lines.
Obviously, you would not
DIRECTLY
enter the user entered data into a query, you should useparameters
orVALIDATE
the data to ensure it cannot inject something into your script!